It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set permission on issues creation by issue type

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

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

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

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.

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

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

Is there any solution available for Cloud customers?

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

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Calling all Jira Cloud users! Give us feedback on our exploration of a new navigation.

Hi everyone! My name’s Matt and I’m a product manager at Atlassian. I work in the navigation & findability space for all our Jira Cloud products. We’ve been working on trying to improve the exp...

1,038 views 16 12
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you