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

Servers

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 creator_user_id and creator_app_name properties. If the ticket field is created by an app, creator_app_name is the name of the app and creator_user_id is -1. If the ticket field is not created by an app, then creator_app_name is null

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. 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.
  3. Click Test request to test run your request to the API and see the API's response.