I have a "Send a Custom Email" Post Function script during the "Create" issue transition that isn't working for one specific type of Component. What it is doing is sending an email to the component lead. The ONLY thing strange that I can tell about this component lead is that it contains the character "+" in it. Other than that, I don't know why this is happening.
Here's the error:
2019-12-22 16:40:08,144 https-jsse-nio-10.195.46.227-8443-exec-1 ERROR jason 1000x18457x1 1k195pw 10.195.155.6 /secure/QuickCreateIssue.jspa [c.o.s.jira.workflow.AbstractScriptWorkflowFunction] *************************************************************************************
2019-12-22 16:40:08,146 https-jsse-nio-10.195.46.227-8443-exec-1 ERROR jason 1000x18457x1 1k195pw 10.195.155.6 /secure/QuickCreateIssue.jspa [c.o.s.jira.workflow.AbstractScriptWorkflowFunction] Script function failed on issue: ITIM-69668, actionId: 1, file: null
java.lang.IllegalArgumentException: Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>` out of VALUE_STRING token
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmailCommand["events"])
at com.fasterxml.jackson.databind.ObjectMapper$convertValue$3.call(Unknown Source)
at com.onresolve.scriptrunner.canned.ConfiguredValidatorFactory$asCommand.call(Unknown Source)
at com.onresolve.scriptrunner.canned.AbstractCannedScript$asCommand$0.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.AbstractCannedScript$asCommand.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.workflow.AbstractWorkflowCannedScript$execute$0.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.workflow.AbstractWorkflowCannedScript$execute.call(Unknown Source)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsExecutionHandler$execute$3.call(Unknown Source)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>` out of VALUE_STRING token
If you look closely at the error.
The script is complaining because you've provided and Array type and the function only accepts a String type variable.
Try to convert the Array into a String, most likely you are trying to get the User Object.
Something like this would help.
Bryan, thanks for the quick response. The only issue with your suggestion is that this is using the ScriptRunner "Send Custom Email" - which doesn't really require any groovy programming - it's just fill out the fields, more or less. The only spot where there is any groovy programming is the part that says: Condition or configuration. I have:
issue.issueType.name == 'Incident' || issue.issueType.name == 'Service Request'
in that spot. I'm pretty sure that's not the problem. The real clue, I think, is that this doesn't work for only this one component/component lead. For all of the others it works fine.
Ok, you are correct there is no Groovy scripting except in the condition.
Do one thing, I suspect it may be due to the Unassigned Default assignee.
In the project settings, add the Component lead and the Default assignee.
Experiment the default assignee values, test it in each case.
If it does not work, it is worth creating a ticket to ScriptRunner vendor Adaptavist.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events