Recent searches


No recent searches

How to Update Custom Field Values using API (Not adjusting the field itself)



Posted Sep 16, 2021

Is there a way to make change a customer field status using an API call? I found this article but it looks like it just discusses creating the fields via API but not altering the values: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/

Example 1: We have a user field called "Tracking Number" and would like to send the tracking number string value there via API.

Example 2: We have a drop down field called "Contact Reason" and would like to send the field value there for a particular ticket. 

I thought out a sloppy work around by creating an app and then using Zendesk object / relationships to retrieve the tracking number and status and then display it in app. Our database would then also need to create a new ticket with tags using the following code:

/api/v2/tickets.json
{
"ticket":{
"subject":"Tag Test",
"comment":{
"Body":"This ticket was created by an API and contains tags"
},
"description":"test",
"tags":"[\"TrackingNum\", \"TrackingStatus\", \"ContactReason\"]"
}
}
 
From here we can use triggers but this is super messy and causes other problems.
 
I may be missing something here. Any help is appreciated! 

0

1

1 comment

I had to work hard to find the solution, for a problem that I believe is related to the clarity of the documentation. Also, I had difficulty in getting concrete help in chat with support.

Wanting to work on the user entity, updating its fields, the API to use is: 
https://YOURACCOUNT.zendesk.com/api/v2/users/USERID

As for the content of the request, you can do something like this:

{
"user": {
"user_fields": {
          "DropDownVar": "value",
          "DropDownVar1": "value".
                        }
            }
}

I hope it can help those who will have similar needs.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post