Script Runner - Restrict creation of specific issue type for specific users/groups/project


I am looking for ability to restrict creation of specific issue type for specific users/groups/project.

I found that the easiest solution is a Script runner validator in workflow "create transition"

So I need the condigition:


issueType="IssueType" && user who is creating this issue is member Of Role("Project Role") && project is "PROJECTKEY"

returns true, then issue could not be created.

1) issue type condition is == 'Bug'

2)project role condition is


3) I am not able to find condition for project. I tried

issue.getProjectObject().key == "ABCD-123", but it doesn't work.

Is there a possibility to find a project key? I need to merge these three conditions.

Thank you in advance,


2 answers

1 accepted

This widget could not be displayed.

Hello Fyodor,

Use the following syntax to grab the project in your condition:

issue.projectObject.key == 'ABCD'

The complete condition would look something like:

issue.projectObject.key == 'ABCD' && isUserMemberOfRole('Administrators') && == 'Bug'

Hope this helped!


// Svante

btw: I re-tagged your question to more correct tags. Hope you don't mind :-)

Hello Svante

Thank you for info.

I need to check three conditions, so it seems I need creat multi-level condition, e.g.

if( == 'Bug'){
if(issue.projectObject.key == 'ABCD'){
invalidInputException = new InvalidInputException("Invalid condition!")

In all others situation issue can be created

Is it possible to put such exression in script runner validator?



This widget could not be displayed.
import com.opensymphony.workflow.InvalidInputException

if(issue.projectObject.key == 'ProjectA'){
if( == 'Task'){
invalidInputException = new InvalidInputException("Task can create Manager only!")

But this is not work...

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

91 views 1 0
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you