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.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.