I just need a validator script for a transition. I'd like a validator for when an assignee has to be in a certain project role.
I found this code:
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.security.roles.ProjectRole
import com.atlassian.jira.security.roles.ProjectRoleManager
ComponentManager componentManager = ComponentManager.getInstance()
ProjectRoleManager projectRoleManager = ComponentManager.getComponentInstanceOfType(ProjectRoleManager.class) as ProjectRoleManager
ProjectRole devRole = projectRoleManager.getProjectRole("Lead Software Developer")
projectRoleManager.isUserInProjectRole(issue.assignee, devRole, issue.projectObject)
But I dont think it will be future-compatible with JIRA 7. I'm currently on 6.4.11.
There is a built-in method and example for this in Simple Scripted Validator.
isUserMemberOfRole('Lead Software Developer')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.