Heya!
So, how do I use IsInGroup to check if user in a custom field is in group?
I do know how to use it with that "Assignee" field, but not with a custom one.
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
if ((groupManager.isUserInGroup(issue.assignee?.name, 'kanban_team_D'))) {
return("D");
} else if((groupManager.isUserInGroup(issue.assignee?.name, 'kanban_team_M'))) {
return("M");
} else if((groupManager.isUserInGroup(issue.assignee?.name, 'kanban_team_CRM'))) {
return("CRM")
} else {
return(":(")
}
If your custom field is of the user picker type. then try to use like this
def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field name")
groupManager.isUserInGroup(issue.getCustomFieldValue(cf)?.name, 'kanban_team_CRM')
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.