Update Ticket Field
PUT {{baseUrl}}/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}:{password}
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
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"ticket_field":{"active":true,"agent_description":"Agent only description","collapsed_for_agents":false,"created_at":"2012-04-02T22:55:29Z","description":"Your age","editable_in_portal":false,"id":89,"position":9999,"raw_description":"Your age","raw_title":"Your age","raw_title_in_portal":"Your age","regexp_for_validation":null,"required":true,"required_in_portal":false,"tag":null,"title":"Your age","title_in_portal":"Your age","type":"text","updated_at":"2012-04-02T23:11:23Z","url":"https://company.zendesk.com/api/v2/ticket_fields/89.json","visible_in_portal":false}}