Forums

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

How to hide issue type to Behaviour?

Sema YILDIRIM
Contributor
February 21, 2020

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

Behaviour:

import com.atlassian.jira.component.ComponentAccessor
import groovy.transform.BaseScript
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 != "Beta" &&
issueType.name != "Bug" &&
issueType.name != "Story" )
{
availableIssueTypes.add( issueType )
}
}// Add all the available issue types to the form drop down list.
issueTypeField.setFieldOptions(availableIssueTypes)

0 answers

Suggest an answer

Log in or Sign up to answer