Hi All,
Suddenly, our custom email script for workflow transition has started failing with the below error.
Time (on server): Fri Oct 21 2016 12:08:45 GMT-0400 (EDT)The following log information was produced by this execution. Use statements like:log.info("...") to record logging information.2016-10-21 12:08:45,058 ERROR [workflow.ScriptWorkflowFunction]: *************************************************************************************2016-10-21 12:08:45,066 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: null, actionId: 1, file: nulljava.lang.NullPointerExceptionat com.atlassian.jira.issue.managers.DefaultIssueManager.getEntitiesByIssue(DefaultIssueManager.java:395)at com.atlassian.jira.issue.managers.DefaultIssueManager.getEntitiesByIssueObject(DefaultIssueManager.java:410)at com.atlassian.jira.issue.comments.CommentSearchManager.getComments(CommentSearchManager.java:102)at com.atlassian.jira.issue.comments.DefaultCommentManager.getComments(DefaultCommentManager.java:165)at com.atlassian.jira.issue.comments.CommentManager$getComments$1.call(Unknown Source)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.mergeEmailTemplate(SendCustomEmail.groovy:844)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.mergeEmailTemplateBody(SendCustomEmail.groovy:816)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$mergeEmailTemplateBody$2.callCurrent(Unknown Source)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.constructMail(SendCustomEmail.groovy:367)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$constructMail$7.callCurrent(Unknown Source)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.constructMailWithConditionResult(SendCustomEmail.groovy:348)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$constructMailWithConditionResult$6.callCurrent(Unknown Source)at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.doScript(SendCustomEmail.groovy:445)
We havent changed anything in our environment, and it just stopped working. Our users get notified of the change requests using this and this automation is critical for us to work. Any suggestions on how to fix it ?
Thanks,
Karan
The issue was resolved by moving the custom email post function to the last position in the workflow transition post functions list (under all the default functions).
Hi Steven,
It used to work fine for us as well as the first post function on the list, but it stopped working sometime back. We are not sure what broke it - may be the upgrade to Scriptrunner.
Thanks,
Karan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for replying back the fix! I have always placed my own Send Email Post-Functions at the bottom, since that's where other events are. I'm not too sure what could cause this though!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steven,
Thank you for getting back. The issue was resolved by moving the custom email post function to the last positions in workflow transition post functions list (under all the default functions).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you post the script? A NPE implies you're performing actions on null data/fields.
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.