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

Jenkins not sending valid report email attachment for failure build

XMLWordPrintable

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

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

              Created:
              Updated:
              Resolved: