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

l June 13, 2017

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

0 votes
Daniel Yelamos [Adaptavist]
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.
June 14, 2017

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 { it.name 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.

Cheers
DYelamos

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events