It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Send a custom email is not working for only one specific component lead is not working.

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._convert(ObjectMapper.java:3922)
at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:3853)
at com.fasterxml.jackson.databind.ObjectMapper$convertValue$3.call(Unknown Source)
at com.onresolve.scriptrunner.canned.ConfiguredValidatorFactory.asCommand(ConfiguredValidatorFactory.groovy:48)
at com.onresolve.scriptrunner.canned.ConfiguredValidatorFactory$asCommand.call(Unknown Source)
at com.onresolve.scriptrunner.canned.AbstractCannedScript.asCommand(AbstractCannedScript.groovy:95)
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(AbstractWorkflowCannedScript.groovy:18)
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.jira.workflow.AbstractScriptWorkflowFunction$_run_closure1.doCall(AbstractScriptWorkflowFunction.groovy:93)
at com.onresolve.scriptrunner.jira.workflow.AbstractScriptWorkflowFunction$_run_closure1.doCall(AbstractScriptWorkflowFunction.groovy)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsManagerImpl$DiagnosticsExecutionHandlerImpl.execute(DiagnosticsManagerImpl.groovy:325)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsExecutionHandler$execute$3.call(Unknown Source)
at com.onresolve.scriptrunner.jira.workflow.AbstractScriptWorkflowFunction.run(AbstractScriptWorkflowFunction.groovy:86)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>` out of VALUE_STRING token

1 answer

0 votes
Bryan Bojorque Community Leader Dec 22, 2019

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.

Foo(UserObject.getEmail().asString())

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.

Bryan, there already is a component Lead and the default assignee is me.  I've already created a ticket for Adaptavist.  Thanks.

Like Bryan Bojorque likes this

Hey Jason,

 

Have you found the issue in the meantime? The same thing is happening to me.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Events near you