You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.