I tried the following script but didn't get the desired result.
Script ::
import com.atlassian.jira.component.ComponentAccessor
return ComponentAccessor.getGroupManager().getGroupsForUser(issue.getAssignee())
Result ::
[com.atlassian.crowd.embedded.impl.ImmutableGroup@5ab0a9b9, com.atlassian.crowd.embedded.impl.ImmutableGroup@aa6f0adf, com.atlassian.crowd.embedded.impl.ImmutableGroup@1845f18a, com.atlassian.crowd.embedded.impl.ImmutableGroup@86a, com.atlassian.crowd.embedded.impl.ImmutableGroup@7403ff3, com.atlassian.crowd.embedded.impl.ImmutableGroup@e239b761, com.atlassian.crowd.embedded.impl.ImmutableGroup@42b66b45, com.atlassian.crowd.embedded.impl.ImmutableGroup@9099bd68, com.atlassian.crowd.embedded.impl.ImmutableGroup@852dcdc5, com.atlassian.crowd.embedded.impl.ImmutableGroup@976d6f29, com.atlassian.crowd.embedded.impl.ImmutableGroup@95a62d82, com.atlassian.crowd.embedded.impl.ImmutableGroup@ca5d9308, com.atlassian.crowd.embedded.impl.ImmutableGroup@58e3f5fa, com.atlassian.crowd.embedded.impl.ImmutableGroup@2d90ea2a]
import com.atlassian.jira.component.ComponentAccessor
def groupObjs = ComponentAccessor.getGroupManager().getGroupsForUser(issue.getAssignee())
String[] groupNames = new String[groupObjs.size()]
for (int i = 0; i<groupObjs.size(); i++)
{
groupNames[i] = groupObjs[i].name
}
return groupNames.toString()
Your solution was close, but you were returning the actual group object, not the name. You may need to do some reformatting in the above script, but it's the right data.
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.