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

          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: