PUT /api/v2/ticket_fields/{ticket_field_id}
Updating drop-down field options
You can also use the update endpoint to add, update, or remove options in a drop-down custom field. Updating field options for multi-select fields works exactly the same as drop-down field options.
Important: Unless you want to remove some options, you must specify all existing options in any update request. Omitting an option removes it from the drop-down field, which removes its values from any tickets or macros.
Use the custom_field_options
attribute to update the options. The attribute consists of an array of option objects, with each object consisting of a name
and value
property. The properties correspond to the "Title" and "Tag" text boxes in the admin interface. Example request body:
{"ticket_field": {
"custom_field_options": [
{"name": "Apple Pie", "value": "apple"},
{"name": "Pecan Pie", "value": "pecan"}
]
}
}
Example Request
curl https://{subdomain}.zendesk.com/api/v2/ticket_fields/{id}.json \
-d '{"ticket_field": {"custom_field_options": [{"name": "Apple Pie", "value": "apple"}, {"name": "Pecan Pie", "value": "pecan"}]}}' \
-H "Content-Type: application/json" -X PUT \
-v -u {email_address}/token:{api_token}
Example Response
Status: 200 OK
{
"ticket_field": {
"id":21938362,
"type":"tagger",
"title":"Pies",
...
"custom_field_options": [
{
"id":21029772,
"name":"Apple Pie",
"raw_name":"Apple Pie",
"value":"apple",
"default":false
},
...
]
}
}
Allowed for
- Admins
Servers
- https://{subdomain}.{domain}.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
ticket_field_id |
Integer | Yes |
The ID of the ticket field |
Query parameters
Name | Type | Required | Description |
---|---|---|---|
creator |
Boolean | No |
If true, displays the |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.