Restrict creation of certain issue types to members of a project role

Add this script to a ScriptRunner Simple Scripted Validator on the Create step of a workflow to restrict the creation of certain types of issues to members of a specified project role.

Requirements

Jira Jira (7.7 - 8.6)

    
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.security.roles.ProjectRoleManager // the name of the project role final String roleName = "Project Manager Role" // the name of the issue type final String issueType = "Epic" def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager) def role = projectRoleManager.getProjectRole(roleName) issue.issueType.name == issueType && projectRoleManager.isUserInProjectRole(issue.reporter, role, issue.projectObject)
Discovered an issue? Report it here

Suggested for you

Appears in these Collections