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

Jenkins not sending valid report email attachment for failure build

    Details

    • Similar Issues:

      Description

      I have a Jenkins job which will email the Test.html report for every build. The issue here is whenever the build is success, I'm getting the email with attachment. But when the Build is failed, (even though the Test.html file is generated), I'm not getting the email itself.

      I have tried to add try {} and finally{}. When I add finally in the Jenkins script, its sending some 'older' report and not the 'current generated' report.

       

      node ('docker')

      { env.ForEmailPlugin = env.WORKSPACE emailext attachmentsPattern: 'Test1.html', body:'''Hi , Please find the Sanity Test report!!!''', subject:currentBuild.currentResult + " : " + env.JOB_NAME, to: 'xxx@gmail.com' }

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          That's the only thing in your Jenkinsfile?

          Show
          slide_o_mix Alex Earl added a comment - That's the only thing in your Jenkinsfile?
          Hide
          infokarthi14 Karthi Palanisamy added a comment -

          Yes, Remaining codes are maintained by the admin team. I don't have access to it.

          Show
          infokarthi14 Karthi Palanisamy added a comment - Yes, Remaining codes are maintained by the admin team. I don't have access to it.
          Hide
          slide_o_mix Alex Earl added a comment -

          Nothing in your code shows anything really useful, so without additional details there really isn't anything I can do. I have emails working fine with success and failure cases, so my guess is it is something related to whatever is around your code.

          Show
          slide_o_mix Alex Earl added a comment - Nothing in your code shows anything really useful, so without additional details there really isn't anything I can do. I have emails working fine with success and failure cases, so my guess is it is something related to whatever is around your code.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              infokarthi14 Karthi Palanisamy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: