Script to display specific values in select list depends on another select list value

I need to develop a script which will allow to display only specific values (B2,B3)from a select list B when A1 value has been selected in field A.

1 answer

Hello Lynn.

The way that you would apply this would be depending wether your fields are statically or dynamically populated.

If they are statically populated you can use a custom field that is a cascading select. If you don't know how to set one up, let me know and I will prep a documented example for you.

If they are dinamically populated you might need to use something like we have in our documentation here.

if (getActionName() == "Terminate") {

def constantsManager = ComponentAccessor.getConstantsManager()

//Here you filter from your options def allowedResolutions = constantsManager.getResolutionObjects().findAll { in ["Won't Fix", "Incomplete", "Cannot Reproduce"] }
//here you restrict your options with setFieldOptions getFieldById(RESOLUTION).setFieldOptions(allowedResolutions) }

In the example, they are dependent on the action name(line 1 of the script), but you can make them dependent on a field value with getFieldValue(). If you need further help please don't hessitate to ask.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


244 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you