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

Provide a token so that build failure causes can be included in build failure emails

      The Build Failure Analyzer plugin provides some very handy information. I'd love to be able to include this information in the email notices that Jenkins sends out when builds fail, so that our developers can sometimes save time by not having to log in to Jenkins to see why a build failed.

      The Jenkins email-ext plugin allows administrators to construct the email body contents using a series of tokens. Could Build Failure Analyzer provide a token that lists the failure analysis reasons, descriptions, and links to the indications?

          [JENKINS-17658] Provide a token so that build failure causes can be included in build failure emails

          rsandell added a comment -

          Version 1.10.0 (released Sep 19, 2014)

          rsandell added a comment - Version 1.10.0 (released Sep 19, 2014)

          Steve Mokris added a comment -

          Works nicely. Thanks!

          Steve Mokris added a comment - Works nicely. Thanks!

          hugo fonseca added a comment -

          I've being struggling to get this token in my groovy template. Anyone knows how can I get this token from there?
          Sorry if this is not the right place for this question. I'm newbie at it and this is the first time I ask something here.

          hugo fonseca added a comment - I've being struggling to get this token in my groovy template. Anyone knows how can I get this token from there? Sorry if this is not the right place for this question. I'm newbie at it and this is the first time I ask something here.

          Jason Wong added a comment -

          did you ever find out how to do this? I'm also having the same problems.

          Jason Wong added a comment - did you ever find out how to do this? I'm also having the same problems.

          Steve Mokris added a comment -

          I'm using the Email-ext plugin. In the "Editable Email Notification" post-build step, I added this to the "Default Content" box:

          ${BUILD_FAILURE_ANALYZER, includeTitle=true, includeIndications=true, useHtmlFormat=true}
          

          …which works for me.

          Steve Mokris added a comment - I'm using the Email-ext plugin. In the "Editable Email Notification" post-build step, I added this to the "Default Content" box: ${BUILD_FAILURE_ANALYZER, includeTitle= true , includeIndications= true , useHtmlFormat= true } …which works for me.

          Jason Wong added a comment -

          Yeah, I got that working as well, the problem I have is when I use the same token in a groovy template. Other tokens work though like ${build.*} etc.

          Jason Wong added a comment - Yeah, I got that working as well, the problem I have is when I use the same token in a groovy template. Other tokens work though like ${build.*} etc.

          hugo fonseca added a comment -

          No, I still haven't found the solution for this.
          I tried something like: http://jenkins-ci.361315.n4.nabble.com/Build-Failure-Analyzer-Email-Ext-td4720692.html and when I try the "Email template testing" it works fine but since in the real build the scan is triggered after the email being sent it does not work. :/

          hugo fonseca added a comment - No, I still haven't found the solution for this. I tried something like: http://jenkins-ci.361315.n4.nabble.com/Build-Failure-Analyzer-Email-Ext-td4720692.html and when I try the "Email template testing" it works fine but since in the real build the scan is triggered after the email being sent it does not work. :/

          mishal shah added a comment -

          is it possible to change the order in which BFA runs? I am not able to send out email with BFA info because BFA runs after email plugin is triggered.

          mishal shah added a comment - is it possible to change the order in which BFA runs? I am not able to send out email with BFA info because BFA runs after email plugin is triggered.

          mishal shah added a comment -

          is it possible to change the order in which BFA runs? I am not able to send out email with BFA info because BFA runs after email plugin is triggered.

          mishal shah added a comment - is it possible to change the order in which BFA runs? I am not able to send out email with BFA info because BFA runs after email plugin is triggered.

          mike bayliss added a comment -

          The token can be used in the default content box, so I presume that BFA is actually started by email-ext plugin in that case.

          I've looked at the code but java/groovy isn't my strong point and I can't work out how to start the BFA from the groovy template. If somebody can provide that information there isn't any need for code changes.

          mike bayliss added a comment - The token can be used in the default content box, so I presume that BFA is actually started by email-ext plugin in that case. I've looked at the code but java/groovy isn't my strong point and I can't work out how to start the BFA from the groovy template. If somebody can provide that information there isn't any need for code changes.

            t_westling Tomas Westling
            smokris Steve Mokris
            Votes:
            20 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated: