Looking at Scriptrunner listeners to capture a Version Release Event, then fire off an email with the details of this version release.
I have attempted this using the "Send a Custom Email" built-in listener that fires off from the event (VersionReleaseEvent). It appears to respond to the event but I get the following issue;
2018-08-02 01:46:46,952 ERROR [runner.AbstractScriptListener]: ************************************************************************************* 2018-08-02 01:46:46,952 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.project.VersionReleaseEvent, script: com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail java.lang.IllegalArgumentException: The issue object was not available in the binding, perhaps called from an event handler with a non-issue event at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.doScript(SendCustomEmail.groovy:491)
From the logs it appears that the "SendCustomEmail" script is made for workflow postfunctions and requires an issue to be carried out. As the next line states, the event does not require an issue to be specified. So there appears to be a conflict here where the listener requires a specific issue, where as the event does not need to use an issue.
So I will need to build a custom listener that sends off an email to avoid the need of a issue.
If there is a better way to do this please let me know.
This brings me to my question. How to capture the details of the event (VersionReleaseEvent) so I can use that info in the email itself.
Any advice or comments is greatly appreciated
Thanks
Hello,
I guess you need to write a custom listener. You should catch an event and then send the required mail.
You can find here, how to send mail:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.