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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: email-ext-plugin
    • Labels:
      None
    • Environment:
      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

        Activity

        larrycai Larry Cai created issue -
        slide_o_mix Alex Earl made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        slide_o_mix Alex Earl made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Assignee Slide-O-Mix [ slide_o_mix ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: