It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

l Jun 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

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Marketplace Apps & Integrations

Webinar alert! An IT Admin's Guide to Securing Collaboration at Scale

Hello, Atlassian Community! My name is Dave Meyer and I'm a Principal Product Manager at Atlassian. I wanted to give this community a heads up about an upcoming Webinar that might be of interest...

161 views 2 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you