Script Runner Behaviour for FixVersions

Anca Cristescu
Contributor
September 18, 2024

Hello,

I'm trying to get the FixVersions field to show only the Unreleased versions. I've added for it few lines of code, the list gets populated OK, but... when it's not possible anymore to select anything after the 3rd in the list, and also the filter when I'm typing something is not working. Does anyone have any ideas why this is happening?

 

Here is my code:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.project.version.VersionManager
import com.atlassian.jira.project.version.Version
def versionManager = ComponentAccessor.getVersionManager()
def fixver = getFieldById("fixVersions")

Long projectId = issueContext.projectObject.id
boolean includeArchived = false

List<VersionManager> versions=versionManager.getVersionsUnreleased(projectId,includeArchived) as List

fixver.setFieldOptions(versions)

2 answers

1 accepted

0 votes
Answer accepted
Max Lim _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 21, 2024

Hi @Anca Cristescu, I cannot reproduce this problem, your Behaviour script works fine as initialiser in my local instance, Jira 9.12.1 and ScriptRunner 8.34.0.

The script filters versions just fine. I can select versions after 3rd options in the list. I can select more than 3 options.

Please consider raising this to The Adaptavist Group Support channel.

0 votes
Anca Cristescu
Contributor
December 5, 2024

Hello,

In case anyone else lands on this question... For me the problem was due to huge number of active versions (above 200).

Scriptrunner team is working to fix this. https://adaptavistlabs.atlassian.net/browse/SRJIRA-7720  

Enjoy Jira!

Anca

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events