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.