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

Groovy/ Behaviours script to hide/blur certain issuetypes from certain users, groups or project roles

Hi All 

Warm Greetings!!

Is it possible to hide selected issue types from users unless they are in a specific group? We have a number of issue types that are for internal use only but users often mistakenly use them. We'd like to hide them from everyone but those in our team's group?


Project contains 3 issue types



New Feature


Bug issue type should only be created by users in JIRA-Test group.


I tried simple script validator like

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

but it won't be nice to tell the users that they are not allowed to create issue type after filling entire form.

I remember that @Jamie Echlin [Adaptavist] wrote the similar script to implement this but that script isn't there in or maybe I'm not looking at the correct page.


please suggest


2 answers

Hi Rahul,

I have looked into this issue for you and unfortunately it is not possible to restrict the list of issue types using the Behaviours module of ScriptRunner out of the box. The closest you can do is to set just one issue type based on a users role or group as described in the documentation here.

However I have created a workaround for you which I have tested on my local JIRA 7.1.0 instance running ScriptRunner version 4.3.5.

The way the workaround works is by creating a new custom field of the Single Select List type called Issue Type Selection and adding the issue types that users not in the group can select.

You would then add a behaviour onto the new select field which makes the Issue Type field read only and the new select field mandatory if the user is not in the group and sets the issue type to the value of the Select List Field. Also if the user is a team member then it allows them to use the default Issue Type field and hides the new select field.

I have attached the script and config that is needed for this below. Note - I have used the jira-software-users group as my example admin group but you will need to replace this with the name of the group inside your instance.



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

def issueType = getFieldById(ISSUE_TYPE)
def issueTypeSelect = getFieldByName("Issue Type Selection")

// Get the issueTypeSelect Value as a String
def issueTypeSelectVal = issueTypeSelect.getValue().toString()

// Get a pointer to the current logged in user
def userUtil = ComponentAccessor.getUserUtil()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

// If user is not in admin group then make the field read only
if (!userUtil.getGroupNamesForUser("jira-software-users")) {

    // Set the Issue Type to the Select List Value

// If the user is and admin then they may use the standard Issue Type field
} else if (userUtil.getGroupNamesForUser("jira-software-users")) {

    //Also Hide the Field as the admin does not need it




Screen Shot 2016-10-05 at 16.44.26.png

I hope this helps.



@Jamie Echlin [Adaptavist]


Could you point me to the script or give some insights on this.

thanks in advance.



Suggest an answer

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

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

1,933 views 8 2
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