Hi,
In order to restrict issue types on several projects, we have applied the sample code from https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/restricting-issue-types.html
The code is next:
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
def project = issueContext.projectObject
def projectIssueTypes = project.getIssueTypes()
def issueTypeField = getFieldById(ISSUE_TYPE)
def availableIssueTypes = []
def types_list = ["Bug", "Task", "Epic", "Story", "Story Bug", "Test"]
availableIssueTypes.addAll(projectIssueTypes.findAll { (it.name in types_list) })
availableIssueTypes.each { log.error ">>>>>>>"+it.name+" => "+it.id }
issueTypeField.setFieldOptions(availableIssueTypes)
It seems to be working, except for users with profile language other than instance default.
For those users, we see the "availableIssueTypes" array has the right info, but something at UI level makes that only "Test" issue type is available in the dropdown menu.
Has anybody an idea about a solution for this?
Regards.