Hide select list values based on another field

I have a select list customfield with 15 values. Within my workflow, I want to use the same field throughout, but depending on another field value I only need a subset of the 15 values to display.

Basically there are conditions that only allow certain values to display. I don't want to create a bunch of different fields that only display the right values. I would rather use 1 field and hide values if that's possible.

I am trying to use the behaviours plugin to write a script that will hide these values. Can someone please help with the script that will allow me to do this? Essentially just the line that allows me to hide select list values. 

 

Thank you!

Nick

1 answer

1 vote

It's the same method as discussed here: https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/restricting-priority-and-resolution.html

ie you setFieldOptions and pass a Map of option ID to String. 

Use OptionsManager to get the list of available options, eg https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/postfunctions/set-issue-attributes.html#_setting_checkbox_fields

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

180 views 0 4
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