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, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events