Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63131

email-ext - Incorrect build status when used in pipline before build

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We are using Email Extension plugin to send emails before build.
      Default subject is defined as

      $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!
      

       
      Our Jenkins and email-ext plugin versions are

      Jenkins: 2.235.2
      Email Extension Plugin: 2.69
      

       

      In Freestyle project, Editable Email Notification for Before build it is defined like this 

      When email arrives from Freestyle project, subject for $BUILD_STATUS has value Building and it looks like this

      In Pipeline project there is not explicit command for before build, so we simply used this code below in stage before actual build

      emailext from: EMAIL_FROM, to: '${DEFAULT_RECIPIENTS}', replyTo: '$DEFAULT_REPLYTO', mimeType: 'text/html; charset=UTF-8', subject: '${DEFAULT_SUBJECT}', body: '${DEFAULT_CONTENT}', postsendScript: '${DEFAULT_POSTSEND_SCRIPT}', presendScript: '${DEFAULT_PRESEND_SCRIPT}', recipientProviders: [developers(), requestor(), upstreamDevelopers()]
      

      When email arrives from Pipeline project, subject for $BUILD_STATUS has value SUCCESS and it looks like this

      which is incorrect because the build stage is not jet started.

      We also defined sending email in post stageon Success for both Freestyle and Pipeline project, and when email arrives it has Successful string in subject. That is working OK.

      It seems that in pipeline case, for before build, $BUILD_STATUS in subject is not correctly replaced with Building string. Instead it is replaced with SUCCESS string what is misleading because build nor the other stages were finished.

        Attachments

          Activity

          cmd_zed Cmd Zed created issue -
          slide_o_mix Alex Earl made changes -
          Field Original Value New Value
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Resolved [ 5 ]

            People

            Assignee:
            slide_o_mix Alex Earl
            Reporter:
            cmd_zed Cmd Zed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: