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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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

            Assignee:
            Alex Earl
            Reporter:
            Larry Cai
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: