Set Cascading Select values in create post

I have a cascading-select custom list named "Team" and I want to set each of the Team list values curing a create issue. I can't seem to figure out how to set the primary list and secondary list.

Running JIRA 6.2 and using Groovy

The following code does not seem to work:

Option ctOption = optionsManager.getOptions(cfTeam.getRelevantConfig(issue)).getOptionForValue("TeamA", null);

   Option ctSubOption = optionsManager.getOptions(cfTeam.getRelevantConfig(issue)).getOptionForValue("SubTeam A", null);

   issue.setCustomFieldValue(cfTeam, [ctOption, ctSubOption])

Note, when printing debug statements, ctOption finds "Team A", but ctSubOption does not find "SubTeam A" and cfTeam does not get updated.

Thanks for any help!


2 answers

1 accepted

Accepted Answer
1 vote

are you speaking about multiselect or cascading select field?

if you are trying to set value for cascading field then check the following question

Sorry, I am talking about Cascading Select Field.

then solution is there on other post which i gave on my answer!!

It was perfect. Thank you sooo much!!!


Glad to hear it worked!!

i changed field name from multiselect to cascading select in your question so it will help to other users!!

you must get the option that is relevant for you issue :

FieldConfig clientCustomFieldConfig = clientCustomField.getRelevantConfig(myIssue);
final Options options = optionsManager.getOptions(clientCustomFieldConfig);						 
Option coption = options.getOptionForValue("TeamA", null);

do not use issue.setCustomFieldValue but use updateValue instead

if (coption != null) {
	clientCustomField.updateValue(null, myIssue, new ModifiedValue(null, coption), changeHolder);

as stated n you might want to look at

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26,247 views 2 7
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