Web Service Update Ticket
Hi,
I want to build a webservice method for a workflow step that will update only the status of a ticket. I built such a method, https://support.einsteinmed.edu/TDAdmin/EC907A1C-A5B8-423A-B989-B2165ED67FDF/2739/WebServiceMethods/Index/#/4387/edit, but it wiped out everything else. Rather than have an attribute for every single field, is there a way to call out just the one field? Here is the ticket in question: https://support.einsteinmed.edu/TDNext/Apps/2739/Tickets/TicketDet?TicketID=26481715.
I repopulated all the fields, but you can see in the field what happened.
Thanks,
Sheila
Answers (2)
Hello Sheila,
The best way to do this would be the ticket PATCH method. You can read about that here: https://support.einsteinmed.edu/TDWebApi/Home/section/Tickets#PATCHapi/{appId}/tickets/{id}?notifyNewResponsible={notifyNewResponsible}
And also here: https://support.einsteinmed.edu/TDWebApi/Home/AboutPatching
Sincerely,
Mark Sayers
Sr Support Consultant, CS
For https://support.einsteinmed.edu/TDAdmin/EC907A1C-A5B8-423A-B989-B2165ED67FDF/2739/WebServiceMethods/Index/#/4387/edit, here's what I have. Getting an error that it can't parse. Clearly I am missing something.
{"ID":-1,"Message":"patch must not be null. Errors:\r\n* Exception Message: The JsonPatchDocument was malformed and could not be parsed."}
{
"AppID":"2739",
"ID":"{{id}}",
"TypeID":"39260",
"FormID":"51958",
"Title":"{{Title}}",
"AccountID":"103874",
"StatusID":"{{StatusID}}",
"PriorityID":"6304",
"RequestorUid":"{{RequestorUid}}",
[
{op: "replace", path: "/StatusID", value: "128743"},
]
} - Sheila McBride Thu 9/19/24 11:21 AM
That wouldn't be the correct formatting for a PATCH call. In a PATCH call, you just state the operation, path, and value of only the property or properties that the call is changing.
So just this part would be your call's Body:
[
{op: "replace", path: "/StatusID", value: "128743"},
]
In the article https://support.einsteinmed.edu/TDWebApi/Home/AboutPatching, it shows quotations around op, path, and value. Just in case that matters. - Sheila McBride Thu 9/19/24 12:56 PM