I have a code to assign users to task based on their role in the Project Server Resource Center. The custom fields which are used are a Task Level "Task_Role" Field and Resource Level "Res_Role" Field. I am comparing the values in the both fields and assigning it to task.
When I try to iterate over tasks and make an assignment, I have to write the following: -
QueueJob qJobtoUpdate = dp.Update();
JobState jobState = projContext.WaitForQueue(qJobtoUpdate, timeoutSeconds);
This is done for every task in the project by running a loop, and then after the loop, I checkIn the project.
On analysing, I found that for every single task, the above line takes around 5-8 seconds, and hence makes this process slower.
Is there a solution for the above scenario. Kindly provide some pointers.
Thanks & regards, Divyang Agrawal
Just update the project once instead of each time you create a new assignment