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.
Hey Manuel,
I just tested your script on jira 7.13 and it seems to work, if I change my profile language I get a list of issue types from the behaviour with the translated values.
Perhaps you could try working with the ID's instead?
Hi Tessa,
You'right, I've tested in a fresh installation of 7.9.2 (same versión as the one failing) and it's working ok.
It seems like any kind of corruption on the issue types.
This momment I'm checking the database tables.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manuel,
I have the same problem.
Have you found a solution?
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Patrick,
I received an email about this issue fixed in the last release of Scriptrunner.
I haven't tried yet.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the same Problem and now after Bugfixes: https://productsupport.adaptavist.com/browse/SRJIRA-3720 and https://productsupport.adaptavist.com/browse/SRJIRA-4263 it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.