Hi All
I have a multi issue picker custom field.
I need to add a new value to the custom field from my listener. I can manually add value, however I am not able to add programmatically from my listener.
def issueService = ComponentAccessor.issueService
def issueInputParameters = issueService.newIssueInputParameters()
//String valueToUpdate = issue_res.getKey() // tried this also
String valueToUpdate = issue_res.getKey()+" "+myValue
issueInputParameters.addCustomFieldValue(productsField, valueToUpdate)
But the field is not getting updated.
I see this error:
2022-04-24 11:42:15,385 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: null groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.IssueInputParametersImpl.addCustomFieldValue() is applicable for argument types: (com.onresolve.scriptrunner.runner.field.IssueParametersCapturingImmutableCustomFieldWithDefaultValueOperations...) values: [Products, SREG-31383 PowerEdge Platform] Possible solutions: addCustomFieldValue(java.lang.Long, [Ljava.lang.String;), addCustomFieldValue(java.lang.String, [Ljava.lang.String;), getCustomFieldValue(java.lang.String), getCustomFieldValue(java.lang.Long) at Script1077$_run_closure1.doCall(Script1077.groovy:72) at Script1077.run(Script1077.groovy:65)
Any help is appreciated.
Thanks
Abe
Try using the fields ID
issueInputParameters.addCustomFieldValue(productsField.id, valueToUpdate)
From the documentation.
addCustomFieldValue(Long customFieldId, String... values)
Your first argument must be the fields ID and the second argument/s are string/s.
If you look at the fields ID it may be something like customfield_1234 use the 1234 in this method.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.