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

JIRA Behaviours - how to use setFieldOptions for cascading select field?

I'm trying to set up functionality similar to but instead of a single or multi select field, I'm trying to do so with a cascading select field. The below code will populate the first dropdown of a cascading select field, but none of the values from the second dropdown show up. Does anyone have any information on how the data needs to be formatted in order to get the setFieldOptions method to work for both dropdowns in a cascading select field?


FormField functionalArea = getFieldByName("Functional Area")
def ops = ["-1":"None"]
ops.put("50632","508 Compliance Testing")
ops.put("50620","Activity Tracking")

3 answers

1 accepted

0 votes
Answer accepted

I don't remember if cascading selects are properly supported or not, but your example code is what you'd use for setting a single select. For cascading selects the values should themselves be option ID->value maps.

I was thinking about that too. But doing this seems to not adjust the values seen on the screen at all. No errors in the log either. Then I started thinking again, wouldn't the second value in the map need to be a list of maps in order to handle multiple values in the second dropdown? I implemented the below map to setFormValues() with, and again, it doesn't appear to adjust the values either with no errors in the log. I enabled debugging and it returns a map. def ops = [:] ops.put(["-1":"None"],["-1":"None"]) ops.put(["50632":"508 Compliance Testing"],["-1":"None"]) ops.put(["50620":"Activity Tracking"],[["-1","None"],["50621":"To Do List"],["50628":"Work Activity Log"]]) /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json [onresolve.jira.groovy.BehaviourManagerImpl] Returning map: [customfield_10081:[fieldOptions:[[-1:None]:[-1:None], [50632:508 Compliance Testing]:[-1:None], [50620:Activity Tracking]:[[-1, None], [50621:To Do List], [50628:Work Activity Log]]], fieldType:com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect, displayName:Functional Area]] Is there any way you could determine if cascading selects are properly supported? I'm starting to get the feeling they aren't based on my inability get it to work with all the different data types I've tried to put in here.

I do not have a functional test for cascading selects, which I'm afraid suggests to me that they are not implemented. There is also

Alright. I think I'll just mark this as an accepted answer because functionality not implemented is what it is. I'm sure if you do implement it in the future, you will put it in the release notes for the plugin. Thanks for looking into this and thanks for making a great plugin for JIRA.

thanks for your understanding.

Adam Yerkman - did you find any alternative to do this?

I haven't found an alternative yet. I told the group that requested it from me that it wasn't possible to my knowledge, and I will investigate any solutions that might implement this functionality.

I did a work-around. I use two select list that act as this cascading select list. Probably u can do that :)

Hi @Adam Yerkman, have you found a solution for this?

Thank you in advance

Don't think so:


SRJIRA-2125 is about the ability to choose values in the form - setFormValue() i.e. the values have to already be present in the select list in order to be set.


The question is about setting the *list of options* in a cascading select list i.e. using setFieldOptions on a cascading select

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

932 views 8 25
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