Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

muliple select list scripted field

gagan m s March 5, 2019

Hello,

im trying to update the multi select list using script runner.

below is my script.

def cf = customFieldManager.getCustomFieldObject("customfield_12345")

def option = optionsProgManager.getOptions(fieldConfig).find {it.value == "4"}
def currentOptions = issue.getCustomFieldValue(cf)
issue.setCustomFieldValue(cf,[option])

however the script updates the value only on view screen.

and if we edit or export the issue the old value remains.

1 answer

1 accepted

0 votes
Answer accepted
Hector
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.
March 5, 2019

Hi @gagan m s , 

You would need to use ChangeHolder class to ensure and store your script/person execution the code, can actually change it. See and example as follows:

IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();
cf.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(cf), value), changeHolder)

This was answered here as well.

Hope it helps!

gagan m s March 5, 2019

@Hector,

thank you so much :)

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, out of office, loom, confluence, async collaboration, meeting recaps, remote teamwork, team alignment, knowledge sharing, AI-powered notes, productivity tools, workforce continuity, teamwork collection

Put your meeting notes on autopilot with Loom + Confluence

AI-powered meeting notes keep work moving even if you’re out of the office. Enjoy your well-deserved time off and return refreshed, confident you’ll catch up in no time.

Learn more
AUG Leaders

Atlassian Community Events