Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-2081

Improve send custom email diagnostics when it is before create issue post-function

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 4.3.9
    • Fix Version/s: 5.0.11
    • Component/s: None
    • Sprint:
      Sprint 29 - Ends 10 May, Sprint 30 - Ends June 20, Sprint 31 - Ends June 27
    • Critical Points:
      0.7

      Description

      Placing the send custom email post-function before the create issue post-function results in the following exception:

      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: null
      java.lang.NullPointerException
      	at 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 should check if the issue is null and if so provide some diagnostics in the log so the user can move the post-function after the create one.

        Attachments

          Activity

            People

            Assignee:
            dyelamos Daniel Yelamos [X] (Inactive)
            Reporter:
            amarkham Adam Markham
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Remaining Estimate - 3 days
                3d
                Logged:
                Time Spent - Not Specified
                Not Specified