API call, utilizing "markDone" for task | Community
Skip to main content
New Participant
February 8, 2024
Solved

API call, utilizing "markDone" for task

  • February 8, 2024
  • 3 replies
  • 1073 views

We have been successfully using an API to search for specific tasks and mark them done/complete.
The following has worked as expected, when one user is assigned to the task:

  1. Call Workfront's API
  2. Search for the project number
  3. This returns the projectID
  4. Use the projectID and search for task name "Build"
  5. This returns taskID
  6. Use taskID and call "markDone"

We are now assigning two people to the "Build" tasks, but the above will only update the task as "Done with my part." What should we use other than markDone so that the task will be Complete?

We also tried assigning a Team to the task, but the status did not update at all.

 

Any ideas?? Thank you!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lgaertner

Hello Cathy,

 

If more than one object is assigned to a task, it is necessary to pass a status as an argument.

 

So, if you call the action markDone, you also have to pass something like this in your body. Before you will need to check, which key corresponds to completed in your statuses.

 

{ "status": "CPL" }

 

This should finally complete the task.

 

For me it would be interesting, how your workflow is set up, as I only see the possibility to set markDone via API, if you use one of the assigned users for the API call. If you are using a dedicated account for API calls, there is no possibility to pass an assignmentID to mark a task as done, which is not assigned to this user.

 

Regards

Lars

 

3 replies

lgaertner
lgaertnerAccepted solution
New Participant
February 9, 2024

Hello Cathy,

 

If more than one object is assigned to a task, it is necessary to pass a status as an argument.

 

So, if you call the action markDone, you also have to pass something like this in your body. Before you will need to check, which key corresponds to completed in your statuses.

 

{ "status": "CPL" }

 

This should finally complete the task.

 

For me it would be interesting, how your workflow is set up, as I only see the possibility to set markDone via API, if you use one of the assigned users for the API call. If you are using a dedicated account for API calls, there is no possibility to pass an assignmentID to mark a task as done, which is not assigned to this user.

 

Regards

Lars

 

New Participant
February 9, 2024

Thanks so much, Lars! Worked like a charm.

skyehansen
New Participant
February 8, 2024

I have to say, I'm pretty curious about what would happen if you called markDone twice (one for each user)

New Participant
February 9, 2024

Full transparency - this is not my process, but I wondered the same thing and asked my user. He said that it just marks his portion of the task done again, it does not mark the other assignee's part Done.

ChrisStephens
New Participant
February 8, 2024

Are you just trying to update the status? If so, could you just update the status directly?