Hi. I'm trying to update some Custom Select Field in scriptRunner.
- I'm getting the value from issue1 with
issue1.getCustomFieldValue(customFieldId)
- I need to set this value in issue2 (same project, same issuetype)
- I'm using this:
issue2.update {
setCustomFieldValue(customFieldId, valueReadFromIssue1)
}
It works fine for most fields, but from "Select Field" field types the value is not updating.
No error messages.
Does somebody help me to solve this question?
Hi @Alex Sander ,
@MattD 's script will help you solve your issue, I am just conscious that uses the old, Pure Java API method, rather than HAPI, which you report as not working. I just wanted to ask a few questions to see if we can get to the bottom of it to keep your script simple!
I built out the same code in essence and it worked:
def newValue = Issues.getByKey('WEB-5').getCustomFieldValue(10613)
log.debug(newValue)
Issues.getByKey('WEB-4').update {
setCustomFieldValue('Custom Single Select', newValue)
}
If you could, could you log out the value of the field? Also, if you are willing, could you share the version of ScriptRunner you are on?
Kind regards,
Bobby
Hi @Bobby Bailey
I'm using scriptrunner ver v. 8.36.0.
I guess it's a bug, or some wrong with my test environment, user or something else.
A coworker is helping me and it works for him the same way you did.
thanks for helping.
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh interesting! I am glad you have got it working!
If you run into that issue again and can reproduce it, please let us know so we can catch and fix it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.