Get cascading select value

Hi, 

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

0 votes
Accepted answer

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"))
}

Thanks 

1 vote
Vasiliy Zverev Community Champion Oct 17, 2016

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
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

339 views 0 1
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