Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

[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 edited

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
atlassian, atlassian community, university, on demand, transition to jira cloud

Transition to Jira Cloud

Switch to Jira Cloud with Atlassian University! Explore new navigation, issue views, and Cloud features like team-managed projects and automation. Tailored for Data Center users & admins, these courses ensure a smooth transition. Start your journey today!

Enroll now
AUG Leaders

Upcoming Jira Events