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

groovy template can't differ success and failure build in email

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • email-ext-plugin
    • None
    • Ubuntu 11.10/Openjdk/jenkins 1.452

    Description

      Using email-ext plugin, and set use groovy html template

      • Content Type : HTML
      • Default content ${SCRIPT}

      When the build is SUCCESS, it is still use yellow.gif instead of blue.git

      Problem:
      <%= build.result == 'SUCCESS' ? "blue.gif" : build.result == 'FAILURE' ? 'red.gif' : 'yellow.gif' %>" />
      build.result is not string, so the compare is false always.

      Solution:
      <%= build.result.toString() == 'SUCCESS' ? "blue.gif" : build.result.toString() == 'FAILURE' ? 'red.gif' : 'yellow.gif' %>" />

      I push the code into github

      Attachments

        Activity

          Code changed in jenkins
          User: Larry Cai
          Path:
          src/main/resources/hudson/plugins/emailext/templates/groovy-html.template
          http://jenkins-ci.org/commit/email-ext-plugin/09760ee89846b3598dbcf0fa34808024772a5320
          Log:
          JENKINS-13191 bug fix for groovy default template error on success build

          url for the bug https://issues.jenkins-ci.org/browse/JENKINS-13191
          build.result == SUCCESS is always false due to build.result is not string
          convert to string directly in template to solve this

          could be update in java codes as well

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Larry Cai Path: src/main/resources/hudson/plugins/emailext/templates/groovy-html.template http://jenkins-ci.org/commit/email-ext-plugin/09760ee89846b3598dbcf0fa34808024772a5320 Log: JENKINS-13191 bug fix for groovy default template error on success build url for the bug https://issues.jenkins-ci.org/browse/JENKINS-13191 build.result == SUCCESS is always false due to build.result is not string convert to string directly in template to solve this could be update in java codes as well

          Code changed in jenkins
          User: slide
          Path:
          src/main/resources/hudson/plugins/emailext/templates/groovy-html.template
          http://jenkins-ci.org/commit/email-ext-plugin/0d17e14249c0e43bb2153cc3ed830fccc3f8026c
          Log:
          Merge pull request #28 from larrycai/master

          JENKINS-13191 bug fix

          Compare: https://github.com/jenkinsci/email-ext-plugin/compare/b19a265...0d17e14

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: slide Path: src/main/resources/hudson/plugins/emailext/templates/groovy-html.template http://jenkins-ci.org/commit/email-ext-plugin/0d17e14249c0e43bb2153cc3ed830fccc3f8026c Log: Merge pull request #28 from larrycai/master JENKINS-13191 bug fix Compare: https://github.com/jenkinsci/email-ext-plugin/compare/b19a265...0d17e14
          dogfood dogfood added a comment -

          Integrated in plugins_email-ext #111
          JENKINS-13191 bug fix for groovy default template error on success build (Revision 09760ee89846b3598dbcf0fa34808024772a5320)

          Result = SUCCESS
          larry.caiyu :
          Files :

          • src/main/resources/hudson/plugins/emailext/templates/groovy-html.template
          dogfood dogfood added a comment - Integrated in plugins_email-ext #111 JENKINS-13191 bug fix for groovy default template error on success build (Revision 09760ee89846b3598dbcf0fa34808024772a5320) Result = SUCCESS larry.caiyu : Files : src/main/resources/hudson/plugins/emailext/templates/groovy-html.template
          slide_o_mix Alex Earl added a comment -

          Fixed in 09760ee

          slide_o_mix Alex Earl added a comment - Fixed in 09760ee

          People

            slide_o_mix Alex Earl
            larrycai Larry Cai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: