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


Summary


This article delineates the procedure to capture the options value a designated text field, followed by the subsequent action of transferring these options to populate another dropdown select list field.

Environment

Jira Service Management Cloud
Jira Cloud

Diagnosis

Here in this article, we take a scenario where the JSM Customer fills out a Text Field from a customer portal, and Jira Automation adds this value to a Custom Drop Down Select List field to be used in Jira Issue View

Solution

(info) We will use Rest API to add the options to a select list drop-down field.

Use the steps below to configure a rule 

Step 1: Create an API Key for your admin account
Step 2 : Capture HTTP Response of adding the Option
  • Go to Project Settings > Automation > Create Rule

  • One could either configure an Automated Trigger or have a Manual Trigger; as stated in Jira automation triggers, for the purpose of this example we will use a when Issue Created.

  • Select "Send Web Request " under "Add an Action" 


    Headers ( Optional )

    Authorization

    Basic  <Base64-ApiKey>

    X-ExperimentalAPIopt-in

    BASE64 encode the string on a Linux/Unix/MacOS:

    echo -n user@example.com:api_token_string | base64

  • HTTP Method: POST 
  • Enable "Delay execution of subsequent rule actions until we've received a response for this web request
  • Enable "Continue running the rule even if the request response is not successful (i.e. non-200 response)
  • Add comments/log action to capture STATUS from the Web Response:  {{webResponse.Status}

(lightbulb) Here the WebRequest will try to add a option values, if the option values already exist the webResponse.Status would be a failure and then the Automation Rule will proceed to the next step.

  • Add a "Re-fetch issue" Action to ensure that once the option value are added above, we get the updated dropdown list.
  • (info) The above operations will add the option value to select field if the option does not exist
Step 3 : Edit the Drop Down Field with the Option Value
  • After "Re-fetch issue" Action , add a EDIT Issue Action
  • Select the name of the DropDown field you want to Edit and add the smart value of the Text Field "issue.custom_text_field
  • (info) The above operations will help select the Option value in the Jira Issue View.

Last modified on Apr 18, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.