This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How to update ticket custom fields via REST API?

Hello,

I would like to be able to update the values in the ticket custom fields of our WHD tickets via the REST API.  I have figured out how to use PUT requests to update ticket status, but I cannot figure out how to overwrite existing values in the ticket custom fields section of a ticket.

Can anyone offer me some advice on this?  Let me know what other details would be helpful in answering my question.  Didn't want to overload my initial post with code examples unnecessarily.

  • Here is the info from the REST API:WHD guide regarding how to set the values of the custom fields for a ticket.

    Example: Set Custom Field values (array) of Ticket number 1.

         $ curl -X PUT \ > "https://localhost/helpdesk/WebObjects/Helpdesk.woa\ > /ra/Tickets/1\ > ?apiKey=v32lXMFAi7dl3zGrtETArXqKVF8svfAfXZpIwC0P" HTTP PUT data: { ... "customFields": [ { "definitionId": 1, "restValue": "Version 9.1.7" }, { "definitionId": 2, "restValue": 12345 } ], ... }

    Example: Set Custom Field values (by id) of Ticket number 1.

         $ curl -X PUT \ > "https://localhost/helpdesk/WebObjects/Helpdesk.woa\ > /ra/Tickets/1\ > ?apiKey=v32lXMFAi7dl3zGrtETArXqKVF8svfAfXZpIwC0P" HTTP PUT data: { ... "customField_1": "Version 9.1.7", "customField_2": "12345", ... }

    Hopefully it gets you going in the right direction if you haven't already seen this info.

  • Thank you so much for the info!  Somehow I missed this in the API guide. This was exactly what I needed.  I was using the key "ticketCustomFields" because that's how that section of the JSON is identified when you GET the details for a ticket.  Everything is working fine now.