I have found many scripts on the internet on how to update a task using JSOM, but through JSOM i am able to only checkout, checkin and publish. The task doesnt go to approval center. Is there a way to do it?

  • In Project Online... there is an inbuilt approval center where incase i update any task, it goes there. But this works when i do it the OOTB way... i dont see any options for the same in JSOM Nov 21, 2016 at 7:40

1 Answer 1


I was able to crack it. Below is a sample code. Note (Its not clean but hope you all can understand :P) We need to use Enterprise Resource Entity to get the assignment. Then use submitStatusUpdates which will send it to the approval center

function runMyCode() {
    //Create the ProjectContext object
    projContext = new PS.ProjectContext('PWA Site Here');
    enterpriseresources =PS.EnterpriseResource.getSelf(projContext);
    assignments = enterpriseresources.get_assignments();

    projContext.executeQueryAsync(LoadProject, QueryFailed);
  function LoadProject() {
    //Create variable that will hold specific project information   
     assignment = assignments.getByGuid($.urlParam('AssignmentID'));
    projContext.executeQueryAsync(GetTasks, QueryFailed);

  function GetTasks() {
    assignment.set_item('Custom Field Internal Name',parseInt(percentComplete));
    assignment.set_actualStart(actualstartdateformat.toISOString()); //actualStart
    assignment.set_actualFinish(actualenddateformat.toISOString());  //actualFinish
   projContext.executeQueryAsync(PublishAndCheckIn, QueryFailed);

   function PublishAndCheckIn(response) {

  function QueryFailed(error)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.