Auto update existing dropdown list with new options

Robin Stemmers
Contributor
August 23, 2024

Hello everyone.

 

I am hoping you have an answer for me. If not, well then...

 

Scenario

I have a drop-down field with existing options.

Field Name:  Fruit

Field existing options

  • Apples
  • Pears
  • Oranges

 

Now, I would like to update this field Fruit from another field "Fruit not listed"

 

So then if field Fruit not listed, has Banana added, I would like to update the field Fruit so that the options will then look like this:

 

 

  • Apples
  • Bananas
  • Pears
  • Oranges

 

Is something like this possible?

2 answers

1 accepted

2 votes
Answer accepted
Leo Prakash_CodeForMe_
Contributor
August 23, 2024

Hi @Robin Stemmers ,

As @Marc - Devoteam mentioned there is no built-in components available but can be achieved through automation + rest api

Custom field options rest api documentation: The Jira Cloud platform REST API (atlassian.com)

You can refer this article which describes how you can call rest api in automation: Automation for Jira - Send web request using Jira ... - Atlassian Community

1. Preferred trigger

2. Get field options using send web request

3. if text is one of the options retrieved, then

    3.1. Update select list with text value(smart value passing)

4. Else

    4.1 Send web request to add new option using option create api

    4.1 Update select list with new option/text

 

However if your main goal is to allow non-jira admin to manage field options by themselves then you can try out our plugin Options Manager for Jira | Atlassian Marketplace

Through which you can configure who can control field options(at context level if field has more contexts)

 

Regards,

Leo

CodeForMe

 

Robin Stemmers
Contributor
August 23, 2024

Hi @Leo Prakash_CodeForMe_  and @Marc - Devoteam 

 

I will try this option.

 

Looks like I need to do some self training

Like Marc - Devoteam likes this
0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 23, 2024

HI @Robin Stemmers 

To confirm your scenario, are you trying to take that text value to:

  1. set to an existing value in a select list field, based on the text
  2. potentially add a new value to a select list field

Neither one of these can be done with built-in automation rule features.  Setting the select list field requires the id value, not the text name from the drop-down list.

Instead you would need to call the REST API from a web request action to do this, getting all possible values, and then matching to find the id to set the field.

If you also wanted to add new values to a select list (scenario #2) that would be a second call to a different REST API function.

Robin Stemmers
Contributor
August 23, 2024

Hello @Marc - Devoteam 

 

How would one do this?

 

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 23, 2024

Hi @Robin Stemmers 

@Leo Prakash_CodeForMe_ explained it well.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events