Automation to append the dropdown select list Options based on Customer Input

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

In this article, we cover a scenario where a JSM Customer fills out a Text Field from the customer portal.

Jira Automation adds this field value to a Custom Drop-down Select List field in the Jira work item view for JSM agents to use.

Solution

Get field value with REST API

Since we're moving from a text field to a select list field, we'll actually be adding the text field value as a list option on the select field.

First, we need the select field context ID, which we can use to update that field's options.

Use the steps below to configure a rule.

Part 1: Create an API Key for your admin account

  1. Log in to https://id.atlassian.com/manage-profile/security/api-tokens

  2. Select Create API token

  3. From the dialog that appears, enter a Label for your token and select Create

  4. Copy the token to clipboard, then paste the token elsewhere to save

  5. Encode the API token as outlined in our documentation: https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

Part 2: Capture HTTP Response of adding the Option

In this rule, the WebRequest attempts to add a new option value to the Select List field.

If the option value(s) already exist, the webResponse.Status would be a failure, and the Automation Rule will proceed to the next step.

  1. Go to Project Settings > Automation > Create Rule

    1. Choose either one of the Automated Triggers or use a Manual Trigger

    2. For the purpose of this example, we will use the Work item Created trigger

  2. Add a Send Web request action:

    1. Web request URL: https://your-domain.atlassian.net/rest/api/3/field/{fieldId}/context/{contextId}/option

    2. Headers:

      1. Authorization: Basic <encoded-api-key-from-above>

      2. X-ExperimentalAPI: opt-in

    3. HTTP Method: POST

    4. Body: Custom data:

      1. { "options": [ { "disabled": false, "value": "{{customfield_XXXXX}}" } ] }
  3. Enable"Delay execution of subsequent rule actions until we've received a response for this web request

  4. Enable "Continue running the rule even if the request response is not successful (i.e. non-200 response)

  5. Add comment and/or log action to capture STATUS from the Web Response: {{webResponse.Status}}

  6. Add a Re-fetch work item action to ensure that once the option value(s) are added above, we get the updated dropdown list

Part 3: Edit the Drop Down Field with the Option Value

The next part of the rule will select the Option value in the Jira work item view.

  1. After the Re-fetch work item action, add an Edit work item action

  2. Select the name of the Drop-Down field you want to edit and add the smart value of the Text Field: customfield_XXXXX

Updated on May 22, 2025

Still need help?

The Atlassian Community is here for you.