Hello
Scriptrunner has this very cool "escalation service", which basically runs after a certain interval (in minutes), executes a JQL and for each one of the issues returned executes a certain action.
Now of course most of the users will use this tool to execute a transaction; there are also many very good built-in scripts for the most used purposes, like leaving a comment or updating a field with a certain value.
This is all great, but I would need to achieve something one step further: I would like to copy a custom field value to another custom field.
The code that I have been using in the following:
def cField = customFieldManager.getCustomFieldObject("customfield_25401")
def cFieldValue = issue.getCustomFieldValue(cField)
issue.setCustomFieldValue('customfield_25407', cFieldValue)However it returns an error
"No signature of method: com.atlassian.jira.issue.IssueImpl.setCustomFieldValue() is applicable for argument types: (java.lang.String, com.atlassian.jira.issue.customfields.option.LazyLoadedOption)" [customfield_25407, XX] Possible solutions: setCustomFieldValue(com.atlassian.jira.issue.fields.CustomField, java.lang.Object), getCustomFieldValue(com.atlassian.jira.issue.fields.CustomField)"
I understand that the last line, is either using the wrong method or the arguments are not in the correct format.
Anybody able to help on this one?
Thanks a lot!
Mirco