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, value and allow_solving property. The properties correspond to the "Title", "Tag" and "Required to solve" boxes in the admin interface. Example request body:
{"ticket_field": {
"custom_field_options": [
{"name": "Apple Pie", "value": "apple", "allow_solving": true},
{"name": "Pecan Pie", "value": "pecan", "allow_solving": false}
]
}
}
Example Request
curl https://{subdomain}.zendesk.com/api/v2/ticket_fields/{id} \
-d '{"ticket_field": {"custom_field_options": [{"name": "Apple Pie", "value": "apple", "allow_solving": true}, {"name": "Pecan Pie", "value": "pecan", "allow_solving": false}]}}' \
-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,
"allow_solving":true
},
...
]
}
}
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 |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
creator |
Boolean | No |
If true, displays the |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
ticket_field |
Object | Yes |
The writable attributes accepted when updating a ticket field. The field |
ticket_field.sub_type_id |
Integer | No |
For system ticket fields of type "priority" and "status". Defaults to 0. A "priority" sub type of 1 removes the "Low" and "Urgent" options. A "status" sub type of 1 adds the "On-Hold" option |
ticket_field.description |
String | No |
Describes the purpose of the ticket field to users |
ticket_field.regexp_for_validation |
String | No |
For "regexp" fields only. The validation pattern for a field value to be deemed valid |
ticket_field.required |
Boolean | No |
If true, agents must enter a value in the field to change the ticket status to solved |
ticket_field.custom_field_options[] |
Array | No |
For "tagger" and "multiselect" fields. Unless you want to remove some options, you must specify all existing
options in any update request. Omitting an option removes it from the field. Include an option's |
ticket_field.custom_field_options[].id |
No |
The id of an existing option to update. Omit to create a new option |
|
ticket_field.custom_field_options[].name |
String | No |
The presentation name of the option |
ticket_field.custom_field_options[].default |
Boolean | No |
Whether the option is selected by default |
ticket_field.custom_field_options[].raw_name |
String | No |
The dynamic content placeholder, if present, or the |
ticket_field.custom_field_options[].value |
String | No |
The tag value applied to the ticket when the option is selected |
ticket_field.collapsed_for_agents |
Boolean | No |
If true, the field is shown to agents by default. If false, the field is hidden alongside infrequently used fields. Classic interface only |
ticket_field.position |
Integer | No |
The relative position of the ticket field on a ticket. Note that for accounts with ticket forms, positions are controlled by the different forms |
ticket_field.required_in_portal |
Boolean | No |
If true, end users must enter a value in the field to create the request |
ticket_field.tag |
String | No |
For "checkbox" fields only. A tag added to tickets when the checkbox field is selected |
ticket_field.relationship_filter |
Object | No |
A filter definition that allows your autocomplete to filter results |
ticket_field.relationship_filter.any[] |
Array | No | |
ticket_field.relationship_filter.any[].field |
String | No |
The field the condition applies to |
ticket_field.relationship_filter.any[].operator |
String | No |
The comparison operator for the condition |
ticket_field.relationship_filter.any[].value |
No |
The value or values to compare against. Accepts a string, an array of strings, or |
|
ticket_field.relationship_filter.all[] |
Array | No | |
ticket_field.relationship_filter.all[].field |
String | No |
The field the condition applies to |
ticket_field.relationship_filter.all[].operator |
String | No |
The comparison operator for the condition |
ticket_field.relationship_filter.all[].value |
No |
The value or values to compare against. Accepts a string, an array of strings, or |
|
ticket_field.raw_description |
String | No |
The dynamic content placeholder, if present, or the |
ticket_field.active |
Boolean | No |
Whether this field is available |
ticket_field.raw_title |
String | No |
The dynamic content placeholder, if present, or the |
ticket_field.title_in_portal |
String | No |
The title of the ticket field for end users in the help center |
ticket_field.title |
String | No |
The title of the ticket field |
ticket_field.editable_in_portal |
Boolean | No |
Whether this field is editable by end users in the help center |
ticket_field.agent_description |
String | No |
A description of the ticket field that only agents can see |
ticket_field.raw_title_in_portal |
String | No |
The dynamic content placeholder, if present, or the |
ticket_field.visible_in_portal |
Boolean | No |
Whether this field is visible to end users in the help center |
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.