How can I make both fields in a Cascading Select required?

I have reviewed other topics, but not sure if it is as simple as adding the single line of code: cfValues.get("Application ID")?.keySet()?.size() == 2

I added the line above in the Simple scripted Validator, but it returns an error:

Cannot find matching method java.lang.Object#keySet().

Please check if the declared type is right and if the method exists.  Possible solutions: getAt(java.lang.String) @ line 1, column 1.

I presume this is because the only line of code I added was "cfValues.get("Application ID")?.keySet()?.size() == 2", (without quotes) but I wasn't sure if maybe there was something else I may be missing.


JIRA 7.1





1 answer

I think if you check for NULL(or a default value, like N/A) in your custom field value, you can  maike sure that both cascading lists are filled in. This is how it would look of you used a workflow condition:

def componentManager = ComponentManager.instance
def compAccessor = new ComponentAccessor()
def customFieldManager = compAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjects(issue).find { == 'cf_name'}
def fieldConfig = issue.getCustomFieldValue(cf)
passesCondition = false
passesCondition = true

The String value for a cascading select list looks like this : [0:val1, 1:val2]. It is respresented internally as a HashMap.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,816 views 11 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot