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)