It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scriptrunner behaviour, issue type restriction not working when user has other language than default Edited

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.

1 answer

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

273 views 1 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you