Build Failure Analyzer - Email Ext

207 views
Skip to first unread message

Lukasz Wasylow

unread,
Sep 22, 2014, 9:35:05 AM9/22/14
to jenkins...@googlegroups.com
Hi
I've been trying to use a Build Failure Analyzer to issue some emails using ext-Email.
I ve been trying to use a Jelly Templates but it looks like BFA scanning for issues after ext-Email is being sent.

I have tried to use a token macro ${BUILD_FAILURE_ANALYZER, includeTitle=true, includeIndications=true, useHtmlFormat=true} but either I'm not undestandt how to use it or its not working.

Is anyone had a luck with that email macro?

Regards
Lukasz

Mike Bayliss

unread,
Sep 29, 2014, 9:01:23 AM9/29/14
to jenkins...@googlegroups.com
This came up some time ago when this code sample was posted:


<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" >
<BODY>
    <j:set var="failureCauses" value="${it.getAction('com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction').getFoundFailureCauses()}"/>
    <j:if test="${failureCauses.size() gt 0}">
<j:forEach var="cause" items="${failureCauses}">
${cause.name}
<br/>
${cause.description}
<br/>
</j:forEach>
    </j:if>
</BODY>
</j:jelly>

At the time it didn't work because the BFA ran after the email was sent. After the recent upgrade to the BFA (to 1.10.0) this partially works.

If I use the macro $BUILD_FAILURE_ANALYZER} in the message body (not in a jelly script) the macro is expanded to the failures.

If I use a jelly script with the above code, there are no failures reported.

If I make the message body the macro and the jelly script, the token is expanded and the script also reports the same failures.

There's a start scan routine somewhere is called when the token is evaluated and the routine (I presume) needs to be called before the code fragment above.

Unfortunately I've no time to investigate further since a higher priority task has landed in my in-tray.

Mike

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Bayliss

unread,
Dec 17, 2014, 7:44:49 AM12/17/14
to jenkins...@googlegroups.com
I've just come up with a very crude kludge. When you configure the email options, make the Default Content section something like:

<!--
${BUILD_FAILURE_ANALYZER,useHtmlFormat=true}
-->

${JELLY_SCRIPT,template="template.jelly"}

The resulting email looks fine in Microsoft Outlook - no guarantees for any other mail program.

(But I'd still like to know how to trigger the scan from Jelly or Groovy so I could do this cleanly.)

Mike
Reply all
Reply to author
Forward
0 new messages