Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,638,569
Community Members
 
Community Events
196
Community Groups

Hide Issue Types from Jira Create Issue Screen

Hi All,

This question has been asked multiple times in the community, is there a definite way to hide certain Issue types from the create issue screen so that the users are not able to use them?

Does anyone have a working javascript which can be used in Jira 6.4 ?

 

Please assist.

9 answers

3 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 10, 2019

The answer that you would have found on all the other postings is still true.  Your options are

  • Separate projects
  • Ugly kludges that annoy users by stopping them creating after they've entered data so they lose it all
  • Add-ons such as ScriptRunner that can amend it dynamically
0 votes
Answer accepted
Alexey Matveev
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.
Jan 10, 2019

Hello,

You can also implement this feature with the Power Scripts add-on:

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview

You can find an example here how to restrict the issue type field:

https://confluence.cprime.io/display/TR/Forbidding+users+to+create+some+issue+types

You can also completely hide the field

0 votes
Answer accepted
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 10, 2019

I haven't seen any solution to hide them. Just ones that will stop users from actually creating them. So the user will just be frustrated. The best solution is to put them in a different project that the said users don't have access to. Those with access to both can create a filter to include issues from both projects. 

8 votes
Payne
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.
Jan 10, 2019

If you have the ScriptRunner add-on installed, this can be accomplished with Behaviours.

https://www.adaptavist.com/blog/restricting-issue-types-with-scriptrunner-for-jira/

Thanks for that one! It works perfectly!

Like Payne likes this

This worked for me and implemented. 

Hi 

Is there any solution available in Jira cloud version to hide/disable issue type in create screen

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 09, 2023

We've got Behaviours in Cloud, but it does not yet work with Issue Type (Atlassian have not given us the frameworks we need to be able to do it, but we're working with them on it)

Like John likes this

Hi,

This is not working for Jira cloud

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 18, 2021

Cloud doesn't yet support the solutions given

Like Muhammad Akram Sharifi likes this

After reading all the posts about how to approach hiding issue types from the drop down list, and experimenting with a few, I found the ScriptRunner Behaviour to be easiest to implement.  We simply added the below behaviour for ALL projects.  For us this is a set of issue types from an add-on that we no longer use.  This doesn't prevent users from importing these issue types but we deal with that separately.

import com.atlassian.jira.component.ComponentAccessor
import groovy.transform.BaseScriptimport static

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

// Get all issue types in the system.
def allIssueTypes = ComponentAccessor.constantsManager.allIssueTypeObjects

// Get the issue type form field
def issueTypeField = getFieldById(ISSUE_TYPE)

// A list to add all valid issues types to for setting into the form field.
def availableIssueTypes = []

// The code below works by excluding specific issue types. Although ALL other issue types will
// be added to the availableIssueTypes list, only those that are part of the project's
// issue type scheme will actually be listed.
allIssueTypes.each { issueType ->
if ( issueType.name != "IssueType1" &&
issueType.name != "IssueType2" &&
issueType.name != "IssueType3" )
{
availableIssueTypes.add( issueType )
}
}

// Add all the available issue types to the form drop down list.
issueTypeField.setFieldOptions(availableIssueTypes)

It works in a test environment. But it doesn't work live. Only jira versions are different. Could you help?

We are using Jira Data Center 8.5.0 and ScriptRunner 5.6.11.1-p5.

test environment : v8.2.1

work live: v7.10

I can't speak for whether or not the script I posted would work in older versions of Jira and/or ScriptRunner as I don't have those versions available to test.

It works for us, thanks @Jeffrey Gordon 

  1. Jira v8.5.4
  2. ScriptRunner 6.0.2-p5
import com.atlassian.jira.component.ComponentAccessor
import groovy.transform.BaseScript

// Get Issue Type Field as a constant value
import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE

// Get all issue types in the system.
def allIssueTypes = ComponentAccessor.constantsManager.allIssueTypeObjects

// Get the issue type form field
def issueTypeField = getFieldById(ISSUE_TYPE)

// A list to add all valid issues types to for setting into the form field.
def availableIssueTypes = []

// The code below works by excluding specific issue types. Although ALL other issue types will
// be added to the availableIssueTypes list, only those that are part of the project's
// issue type scheme will actually be listed.
allIssueTypes.each {
issueType ->
if ( issueType.name != "Issue_Type_To_Hide" && issueType.name != "Hide_Another_One" )
{
availableIssueTypes.add( issueType )
}
}

// Add all the available issue types to the form drop down list.
issueTypeField.setFieldOptions(availableIssueTypes)

Thanks @Nic Brough -Adaptavist- @Alexey Matveev @Joe Pitt @Payne
i find the Script Runner solution very intriguing. However, i forgot to mention that I am using Jira 6.4.13 and this version does not support SR 5.4.38.

Any alternatives?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 11, 2019

Get an older version of Script Runner, one that is valid for 6.4 (the UPM under "find new add-ons" should automatically do this for you - it will install the latest compatible version of any add-on, and provide an "upload" link if you can't connect your Jira to the internet)

Like Netmarble likes this

Suggest an answer

Log in or Sign up to answer