get numer of lines,lines after and lines before function in groovy template for email-ext

9 views
Skip to first unread message

venkatesh guttal

unread,
May 15, 2017, 3:36:54 AM5/15/17
to Jenkins Users
Hi,

I am using below groovy script template for my usage..

<BODY>

<!-- CONSOLE OUTPUT -->

<% if(build.result==hudson.model.Result.SUCCESS) { %>
<TABLE width="100%" cellpadding="0" cellspacing="0">
<TR><TD class="bg1"><B>CONSOLE OUTPUT</B></TD></TR>
<% build.getLog(20).each() { line -> %>

<TR><TD class="console">${org.apache.commons.lang.StringEscapeUtils.escapeHtml(line)}</TD></TR>
<% } %>
</TABLE>
<BR/>
<% } %>

</BODY>

Is there any function to get number of line ?, build.getLog(20)--> here we are passing value as 20, i want to put this value in variable and pass to getLog function.

Is there any function for lines after and lines before?


Reply all
Reply to author
Forward
0 new messages