PATCH to calculate a date plus 30 days

I am trying to use a Web Service to update a ticket once it is approved at a point in a workflow. I am able to update the status and create an "Effective Date" utilizing the "Modified Date" using the following code in the body:

  {"op": "replace", "path": "/Attributes/3756", "value" : {{PostDate}}},
  {"op": "replace", "path": "/StatusID", "value": "306"},

But I also want to calculate an end date - using the Modified Date plus 30 days. How is this written? It did not like the following. Maybe it does not like the format?

  {"op": "replace", "path": "/Attributes/4276", "value" : {{PostDate}} + 30},

Tags API webservice PATCH
Asked by Kevin Hull on Wed 4/19/23 4:43 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Thu 4/20/23 4:11 PM

One way a Professional Services associate has advised doing this would be like so:

[ {"op": "add", "path": "/StartDate", "value": "{{start}}-72"}, ]

No feedback
This still give me the message "The JsonPatchDocument was malformed and could not be parsed."
I am thinking that it does not like the format of the date in this, but I am not sure how to get it into the right format. Also, I am using a PATCH - "replace" as I need to update the date if there is one already in there. Not sure if that makes a difference.
- Kevin Hull Fri 4/21/23 9:11 AM
Does it behave any differently if you use the "add" instead of replace? - Mark Sayers Fri 4/21/23 9:29 AM
No difference - same message - Kevin Hull Fri 4/21/23 10:51 AM
Ok we're looking into some things also. We've got it to work with smaller increments of time before, but it doesn't seem to like larger increments like that. We'll keep you posted. The good news though is iPaaS should be able to do this if you wanted to make a flow for that process. - Mark Sayers Fri 4/21/23 10:58 AM