I have a custom field which is a radio button, its values are group names (say G-1, G-2). These groups are defined in the server.
Code below omits the imports for bervity
def groupManager = ComponentAccessor.groupManager
def customFieldManager = ComponentAccessor.customFieldManager
def groupNameField = customFieldManager.getCustomFieldObjectByName("zzGroupPicker")
def groupNameSelected = issue.getCustomFieldValue(groupNameField) as List
def gn = groupNameSelected[0].toString()
def group = groupManager.getGroup(gn)
def msgDebug = "gn='" + gn + "', group=" + group
msgDebug
When I run it in ScriptRunner script console, the output is this:
gn='com.atlassian.crowd.embedded.impl.ImmutableGroup@7056c6db', group=null
So how do I get the group name (G-1) instead of what seems to be the object name?
Thanks
Hello,
It would be
gn.getName()
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would like to do like you but for 2 fields , follow this link for undestand what i want
I need help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We've moved to the cloud, so most of the ScriptRunner stuff is n/a there.
Regarding your need, I have a slightly different requirement (get data dynamically from another source), so I'm looking into the cloud add-on 'External Data for Jira Fields'. It seems that it can provide what you need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay Thanks , but you don't have a idea for do the script because im new administrator in jira and i learn a java (groovy) . And i find the solution but i don't fin a solution or script worked than i can modify. for have what i want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.