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

Jenkins not sending valid report email attachment for failure build

    • Icon: Task Task
    • Resolution: Incomplete
    • Icon: Major Major
    • email-ext-plugin
    • None

      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'
      }

          [JENKINS-58972] Jenkins not sending valid report email attachment for failure build

          Alex Earl added a comment -

          That's the only thing in your Jenkinsfile?

          Alex Earl added a comment - That's the only thing in your Jenkinsfile?

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

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

          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.

          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.

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

              Created:
              Updated:
              Resolved: