Our users (resources) can assign themselves to existing tasks via a custom frontend.
In Project Server 2010 we used the PSI that is no longer supported in the current version.
StatusingClient sc = new StatusingClient(httpBinding, endpointAddress);
sc.CreateNewAssignmentWithWork(parameters);
This assignment-request could then be approved by a projectleader with planning permissions.
We could not find an equivalent method within the CSOM.
Using the CSOM we can only create new assignments as a user with planning permissions (but of course not all users should have those rights).
DraftProject projectDraft = pubProject.CheckOut();
projContext.Load(projectDraft.Tasks);
projContext.ExecuteQuery();
var task = projectDraft.Tasks.Where(t => t.Id == taskUid).FirstOrDefault();
if (task != null)
{
AssignmentCreationInformation assignment = new AssignmentCreationInformation();
assignment.Id = Guid.NewGuid();
assignment.TaskId = task.Id;
assignment.ResourceId = userRes.Id;
task.Assignments.Add(assignment);
projectDraft.Assignments.Add(assignment);
projectDraft.Update();
}
projContext.ExecuteQuery();
projectDraft.Publish(true);
projectDraft.CheckIn(true);
projContext.ExecuteQuery();
Any hints how to solve this task?