Hi,
I am using below script (scripted field) to fetch user' group, but I am not sure how should I get project role instead of assigned group of a user (assignee of an issue).
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()
Hello @hbhardwaj3
Use ProjectRoleManager to get project roles, like this
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager.class)
def projectRoles = projectRoleManager.getProjectRoles(issue.getAssignee(), issue.getProjectObject())
return projectRoles.collect {it.name}.toString()
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.