Get cascading select value


I have a script-post-function on some transition and need to get value (1 level) from the cascading select list,  and, depending on the value assign issue to some user. 

Could you please help with this? 


I've tried to compare like 

if (cfValues['Custom Field']?.get(null) == 'val1')
 issue.setAssigneeId('user 1') 

but as I understood this method works only in validators. 


2 answers

1 accepted

ok, for JIRA 7 the following works: 

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField cf = customFieldManager.getCustomFieldObjectByName("Custom Field")
Map cfVal = issue.getCustomFieldValue(cf) as Map
String value = cfVal.get(null)

if (first == 'val1')
issue.setAssignee(ComponentAccessor.getUserManager().getUserByName("user 1"))


I would reccomend to use 

issue.setAssignee(ComponentAccessor.getUserManager().getUserByName("user 1"))

imstead issue.setAssigneeId('user 1')

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

355 views 0 6
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