How to set permission on issues creation by issue type

Charly Granitto January 24, 2013

I need to restrict Issues Creation, based on it Issue Type. For example, a Team member can create an issue of type "Technical Task" but cannot create a "Story". In that way, the role of the user in a project would determine the permission level to create an issue.

Is that possible?

7 answers

1 accepted

1 vote
Answer accepted
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2013

No it's not. This forum is filled with questions about the same, just do a search.

4 votes
Priyanka Lavania
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 28, 2019

Hi,

I solved this issue using Script runner's behavior, used below code in initializer and it showed Issuetypes based on logged in user, you can validate user against project roles or even groups


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager

import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE

def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def allIssueTypes = ComponentAccessor.constantsManager.allIssueTypeObjects

def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issueTypeField = getFieldById(ISSUE_TYPE)
def availableIssueTypes = []

//use this def and if code to check project roles
/*def remoteUsersRoles = projectRoleManager.getProjectRoles(user, issueContext.projectObject)*.name

if ("Testers" in remoteUsersRoles)
{
availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Task", "Experiment"] })
}
*/

//use this def and if code to check groups
def remoteUsersRoles = ComponentAccessor.getGroupManager().isUserInGroup(user, "jira-administrators")
if (remoteUsersRoles) {
availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Task", "Experiment"] })
}

else {
availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Task"] })
}

issueTypeField.setFieldOptions(availableIssueTypes)


Hope this helps.


Regards,

Priyanka

Madhu Reddy January 9, 2020

Hi @Priyanka Lavania

With this we can stop User groups from creating the issues, But users can move issues to issue type.

Is there a way to stop moving issues to particular type. Thanks in Advance. 

Jaromir Toke July 16, 2020

This does not work for the jira cloud, because the appropriate API is missing. Any solution for Cloud version?

Oriyah Barzilay January 24, 2021

@Jaromir Toke did you find a cloud solution?

1 vote
LucasA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2013

Hi,

Maybe you can set this using Issue Level security:

-https://confluence.atlassian.com/display/JIRA/Configuring+Issue-level+Security

-https://confluence.atlassian.com/display/JIRA/Setting+Security+on+an+Issue

Cheers,

Lucas Lima

0 votes
archivisor July 28, 2016

Maybe not so nice, but there is a way

1. Make unique Workflow for each Type

2. In each workflow set in validator on Creation transition a specific Permission (like Set Issue Security, Delete All Comments, Edit All Comments, Delete All Attachments or Time Tracking Permissions which we are not using)

3. Create permission schema where assign this specific Permission to proper Group of users

at the end Group has right to create issues of specific Type

0 votes
Dishant Mehta April 21, 2015

Is there any solution available for Cloud customers?

0 votes
Christian Schlaefcke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2014

I just played around with the workflow and found out that a scripted validation (coming with the script runner plugin) on the create transition works pretty good as well.

Petra Goldstein July 9, 2015

This covers the 'Create' Transition, which is one case. Does Jira have any validator capability on the 'Edit' operation? Thanks, Mike

Christian Schlaefcke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2015

What exactly do you want to achieve? Maybe the Behaviour-Plugin which is now integrated in the Script Runner would help: https://jamieechlin.atlassian.net/wiki/display/JBHV/JIRA+Behaviours+Plugin

Suggest an answer

Log in or Sign up to answer