I have configured a script field in Jira that gets the list of groups from the reporter in an issue and displays the name of the unit depending on the group. But the group names are not displayed if I change Template from Group Picker to Custom or Text-Field.
If template custom or text-line is set, the result is [com.atlassian.crowd.embedded.impl.ImmutableGroup@7d085d23]
Is there any way to convert these to actual group names?
Next, a check will be set to see if the user has a specific group and the text will be displayed depending on that.
import com.atlassian.jira.component.ComponentAccessor
def userGroups = ComponentAccessor.groupManager.getGroupsForUser(issue.reporter)
if(userGroups.contains("Group")){
return "Developer"
}
Sure, just use the "getName()" method on the group objects.
Or in shorthand:
import com.atlassian.jira.component.ComponentAccessor
def userGroups = ComponentAccessor.groupManager.getGroupsForUser(issue.reporter)
if(userGroups*.name.contains("Group")){
return "Developer"
}
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.