I would like to send a custom email from a workflow post function (using Script Runner), but first I have been using the "Builtin Scripts" in JIRA Administration to experiment.
When I preview various email configurations, the condition correctly evaluates to true, and the email is displayed correctly, but when I try to actually run the email, I get a GroovyCastException (details below). This seems to happen no matter what issue and/or settings I provide.
I've searched this site, as well as Google, and haven't come across a solution. Has anyone seen this, and been able to resolve it?
---
JIRA Version: 5.2.4
Script Runner Version: 2.1.3
Email Details:
Result:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'com.atlassian.jira.event.issue.IssueEvent@6181836a[issue=DGS-128,comment=<null>,worklog=<null>,changelog=[GenericEntity:ChangeGroup][id,16044][author,mhowell][created,2013-04-24 13:01:16.737][issue,12395],eventTypeId=1,sendMail=false,params={},subtasksUpdated=false]' with class 'java.lang.String' to class 'com.atlassian.jira.event.issue.IssueEvent'
Stack Trace:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'com.atlassian.jira.event.issue.IssueEvent@6181836a[issue=DGS-128,comment=<null>,worklog=<null>,changelog=[GenericEntity:ChangeGroup][id,16044][author,mhowell][created,2013-04-24 13:01:16.737][issue,12395],eventTypeId=1,sendMail=false,params={},subtasksUpdated=false]' with class 'java.lang.String' to class 'com.atlassian.jira.event.issue.IssueEvent'
at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:360)
...
Hi Matt, by any chance have you added the 'Send Custom Email' script under Installed Listeners (option under Script Listeners) ? If so, remove it and test the workflow post function again.
I got a similar Class cast error for the same script (Jira 4.1 & Script Runner 1.7.13), when testing (previewing) this built in script. I got this error everytime I specified a 'issue' object. But when I refreshed the script (cleared the entries & also removed it as added listener) & tried again with details (simple email text input data as yours!), it worked fine in workflow post function. I hope it helps.
I will look at that but you may not be able to actually run it from there... it's in the built-in scripts in the admin section just for previewing. If everything else works you should copy it to a workflow post-function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have also put the same configuration into a workflow post function. Although the issue progresses through the workflow correctly, an email never appears to get sent. I also don't see any errors in the catalina.out, or any emails show up in the Mail Queue.
Any suggestions on how to see more details of what might be happening?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Quick update: I tried this again today as a post function, and no errors are logged in catalina.out. No email is sent, despite all other system emails working correctly. I am open to any further suggestions of how to triage this further?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you set the log level to debug and look for messages?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.