Forums

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

ScriptRunner Behaviours: Hidden issue types can still be selected by typing (Ex : Epic)

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 Champions.
January 26, 2026
We are using ScriptRunner Behaviours in Jira Data Center to hide the Epic issue type from the Issue Type dropdown for certain projects. While Epic is hidden from the list, users can still create Epics by manually typing “Epic” into the Issue Type field. Based on the documentation, it appears this is a limitation of Behaviours, as they control only the dropdown, not the type‑ahead search. Can someone confirm whether this behavior is expected and whether there is a supported way to prevent hidden issue types from appearing when typing and how to resolve that?

I used the script below as a scriptrunner behaviour script in an initializer, and I'm using it for 60+ Jira projects.

Please find the attached screenshots for your reference.

 

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 allIssueTypes = ComponentAccessor.constantsManager.allIssueTypeObjects
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser

def issueTypeField = getFieldById(ISSUE_TYPE)
def remoteUsersRoles = projectRoleManager.getProjectRoles(user, issueContext.projectObject)*.name
def availableIssueTypes = []

if ("Jira Security Role" in remoteUsersRoles) {
    availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Epic","Enabler","Feature"] })
}

if ("Users" in remoteUsersRoles) {
    availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Bug", "Defect", "Dependency", "Enhancement", "Spike", "Story", "Sub-task", "Support Request", "Task", "Customer Incident", "Troubleshoot Request", "Improvement""Service Request","Tech Debt","Support"] })
}


issueTypeField.setFieldOptions(availableIssueTypes)
epic1.jpgepic2.jpg

3 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
February 10, 2026

Hi @jira_admin_cu

Please clarify what version of Jira and Script Runner you are using when performing this test?

Thank you and Kind regards,

Ram

0 votes
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 Champions.
February 4, 2026

Support recommendation.

Thanks for contacting us.

Unfortunately, this is a limitation of Behaviours, and the workaround would be to create a simple scripted validator on the affected transitions.

I hope that this is of some help.

Regards,

0 votes
Kristian Walker _Adaptavist_
Community Champion
January 28, 2026

Hi Jira_admin_cu,

Could I please ask you to raise a support request here so that the ScriptRunner on premise support team can assist you with this question.

Regards,

Kristian 

TAGS
AUG Leaders

Atlassian Community Events