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

This widget could not be displayed.

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 

This widget could not be displayed.
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 Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

457 views 3 17
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