1

I am trying to update a Tasks list item via REST and sending the following body to SharePoint API via POSTMAN tool:

{
    "__metadata": {
        "type": "SP.Data.TasksListItem"
    },
    "Status": "Approved",
    "WorkflowOutcome": "Completed",
    "PercentComplete": 1

}

enter image description here

But I only receive the following error, I tried multiple combinations. I tried even updating only Title, but always the same error response. Any clue what is the issue here?

enter image description here

NOTE : I am able to GET the list item : enter image description here

  • Are you able to get the list items in postman? first check it: siteurl/_api/web/lists/getbytitle('List Name')/items – Ganesh Sanap Mar 9 at 13:05
  • Yes i am able to get the list item. – Ishan Mar 9 at 13:13
0

I do not believe that "Completed" is a valid value for "WorkflowOutcome", you have to set it to "Approved". It has been a couple of years since I wrote this, but I performed a similar REST call on an old project that programmatically completes a workflow task using the following:

{
    "__metadata": {
        "type": "SP.Data.TasksListItem"
    },
    "Status": "Approved",
    "FormData": "Completed",
    "WorkflowOutcome": "Approved",
    "Completed": true,
    "PercentComplete": 1

}
| improve this answer | |
  • I had infact tried with WorkflowOutcome as "Approved" and just for testing purpose i was changing those values. With value as "Approved" also it didnt work. I think updatingFormData and Completed did the trick here. Thank you. – Ishan Mar 10 at 11:41
  • 1
    That makes sense, like I said, it has been at least a couple of years, but I recall having to do a lot of trial and error to get it right. – willman Mar 10 at 11:48
  • do you know how to update the comments? I am unable to find the field in the task list where the comment is saved. Hence unable to GET or POST Approval Comments. – Ishan Mar 13 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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