[scriptrunner] set version

plug
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 24, 2025

hi all

   I want to get the custom field value and change the value to the issue version, my code is as follows

import com.atlassian.jira.component.ComponentAccessor

 

def customFieldManager = ComponentAccessor.customFieldManager
def field = customFieldManager.getCustomFieldObject('customfield_14401')
def value = issue.getCustomFieldValue(field)
def lis = value as List

 

issue.setFixVersions(lis)

The code did not report an error or execute successfully

Is that because you're not allowed to do it

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 26, 2025

Hi @plug and welcome,

we need more information about what you are trying to do. Are you trying to do that in a post function? What is type of your original custom field (customfield_14401)?

BTW, the error is that method issue.setFixVersions() need an object Versions and not a simple list.

Please let me know so that I can support you on that.

Fabio 

Suggest an answer

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

Atlassian Community Events