Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I have created some custom issue types Test Cases, Business Requirements, Other Requirements, and want to restrict the actions based on the issue types. Foe example: only testers in a group "Testers" can create the Test Cases issue type. Only BA/PO can create Business Requirements,... How can we achieve this in Jira. I couldn't find a place to control the permission scheme for custom issue types.
You can't do this based on project permission scheme because permission scheme set permissions for whole project.
You can achieve this by using custom validators provided by apps (eg. Script runner, JMWE)
Regards,
Seba
Thanks for the response Seba. Do you know how can it be done via Script runner?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
This code I used in workflow which is shared with many issue types in project:
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
if (issue.issueType.name =='<Issue type name>') {
if (groupManager.isUserInGroup(issue.reporter?.name, '<Group name>')) {
return true
} else return false
} else return true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I'm getting multiple errors while applying the above code. One of them is attached.
Basically, I want to restrict the access for BA (under BA Test group) for creating/viewing the Business Requirement issue type (custom issue type).
Please advise.
Thanks,
Vishu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. You need to replace whole <Issue type name>. Is should be 'Business Requirements'
2. Group should be:
if (groupManager.isUserInGroup(issue.reporter?.name, 'Ba test group')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tried the above code and got two more errors. Sorry, I'm new to scripting in ScriptRunner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
What is the 'ba' variable in line 6? Where do you declare it?
Error from line 5 - where you put this code? Script console, validator, console?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ba is the username of the user who is in group "BA Test group".
I have a bit of a change in the original requirement. Now I want to restrict the access based on the group. For example: only the users who are in "BA Test group" should be allowed to create the Issue Type "Business Requirements". I have different workflows based on different custom issue types. So, I want to add this script in the create part of the workflow and then adding a Validator.
Currently, I have tried running this script in ScriptRunner console but it should be run in Validator of the workflow, right?
Please advise the script for the above. Thanks :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To test it in Script console you need to define issue and put user in ''.
Script should look like this:
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
def issue = ComponentAccessor.getIssueManager().getIssueObject('issueKey')
if (issue.issueType.name =='Prośba o usługę') {
if (groupManager.isUserInGroup(ba', 'BA Test group')) {
return true
} else return false
} else return true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.