Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Assign permissions for different user groups for specific issue types

Sally Wheeler May 17, 2022

I have different groups of people in my department who have restrictions to perform certain tasks within a project. I cannot use the project permissions to control permissions as this applies to the entire project. I need to assign permissions for different issue types using the user groups. Can you please direct me how to do this?

 

1 answer

1 accepted

3 votes
Answer accepted
Kristján Geir Mathiesen
Community Champion
May 17, 2022

Hi @Sally Wheeler and welcome!

I believe you will have to use third party app to help you with this. I am no coder but I do know that this has been done with for example Scriptrunner. Like in the code below, the creation of Issue Type "Story" is limited to those users in the "Product Owner" role:

 

import com.atlassian.jira.component.ComponentAccessor
 
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 = []
 
def remoteUsersRoles = projectRoleManager.getProjectRoles(user, issueContext.projectObject)*.name
 
if ("Product Owner" in remoteUsersRoles)
{
allIssueTypes.each { issueType ->
availableIssueTypes.add( issueType )
 
}
issueTypeField.setFieldOptions(availableIssueTypes)
}
 
else {
allIssueTypes.each { issueType ->
if ( issueType.name != "Story")
{
availableIssueTypes.add( issueType )
}
}
issueTypeField.setFieldOptions(availableIssueTypes)
}
HTH,
KGM

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events