Forums

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

Hide common issue types from across multiple Jira projects.

jira_admin_cu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2025

Hi Team,

We have a requirement to remove three specific issue types—"Epic," "Enabler," and "Feature"—from hundreds of Jira projects. However, we want to keep the existing tickets under these issue types for all projects. Since these 100+ Jira projects have various other issue types, I cannot simply include them all in the user roles. Therefore, I want to exclude these three issue types. I tried using the following ScriptRunner behavior, but it still shows all the issue types available in the project instead of excluding these three. Is there something wrong with my script?

 

scriptrunner script.png

I am in a "User" role, but its displaying "Epic," "Enabler," and "Feature"

issue types.png

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.security.roles.ProjectRoleManager

import com.onresolve.jira.groovy.user.FieldBehaviours

import groovy.transform.BaseScript

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

@BaseScript FieldBehaviours fieldBehaviours

def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)

def constantsManager = ComponentAccessor.constantsManager

def allIssueTypes = constantsManager.allIssueTypeObjects

def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser

def issueTypeField = getFieldById(ISSUE_TYPE)

def remoteUsersRoles = projectRoleManager.getProjectRoles(user, issueContext.projectObject)*.name

def availableIssueTypes = []

if ("Issue Type Visibility Controller" in remoteUsersRoles) {

    availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Epic", "Enabler", "Feature"] })

}

if ("Users" in remoteUsersRoles) {

    def excludedTypes = ["Epic", "Enabler", "Feature"]

    availableIssueTypes.addAll(allIssueTypes.findAll { !(it.name in excludedTypes) })

}



issueTypeField.setFieldOptions(availableIssueTypes)

2 answers

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
October 1, 2025

Hi @jira_admin_cu

Based on what condition do you intend to hide the issue type?

Is it on the current logged-in user's role or group?

If it is based on the User's Role, you can follow the steps provided in this ScriptRunner Documentation, which is the same approach you are using in the code you have shared.

On the other hand, if it is based on the User's group, you can follow the example that I provided in this community discussion.

I hope this helps to answer your question. :)

Looking forward to your feedback.

Thank you and Kind regards,
Ram

0 votes
Matteo Vecchiato
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2025

Suggest an answer

Log in or Sign up to answer