BUILD ${build.result ?: 'COMPLETED'}
URL: ${rooturl}${build.url}
Project: ${project.name}
Date: ${it.timestampString}
Duration: ${build.durationString}
Cause: <% build.causes.each() { cause -> %> ${hudson.Util.xmlEscape(cause.shortDescription)} <% } %>

<% def changeSets = build.changeSets if(changeSets != null) { def hadChanges = false %> <% changeSets.each() { cs_list -> cs_list.each() { cs -> hadChanges = true %> <% cs.affectedFiles.each() { p -> %> <% } } } if ( !hadChanges ) { %> <% } %>
CHANGES
Revision <%= cs.metaClass.hasProperty('commitId') ? cs.commitId : cs.metaClass.hasProperty('revision') ? cs.revision : cs.metaClass.hasProperty('changeNumber') ? cs.changeNumber : "" %> by <%= cs.author %> ${cs.msgAnnotated}
${p.editType.name} ${p.path}
No Changes

<% } %> <% def artifacts = build.artifacts if ( artifacts != null && artifacts.size() > 0 ) { %> <% artifacts.each() { f -> %> <% } %>
BUILD ARTIFACTS
${f}

<% } %> <% try { def mbuilds = build.moduleBuilds if ( mbuilds != null ) { %> <% try { mbuilds.each() { m -> %> <% m.value.each() { mvnbld -> def artifactz = mvnbld.artifacts if ( artifactz != null && artifactz.size() > 0) { %> <% } } } } catch(e) { // we don't do anything } %>
BUILD ARTIFACTS
${m.key.displayName}
<% artifactz.each() { f -> %> ${f}
<% } %>

<% } } catch(e) { // we don't do anything } %> <% def junitResultList = it.JUnitTestResult try { def cucumberTestResultAction = it.getAction("org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultAction") junitResultList.add( cucumberTestResultAction.getResult() ) } catch(e) { //cucumberTestResultAction not exist in this build } if ( junitResultList.size() > 0 ) { %> <% junitResultList.each { junitResult -> junitResult.getChildren().each { packageResult -> %> <% packageResult.getPassedTests().findAll({it.getStatus().toString() == "FIXED";}).each{ test -> %> <% } %> <% packageResult.getFailedTests().sort({a,b -> a.getAge() <=> b.getAge()}).each{ failed_test -> %> <% } } } %>
${junitResultList.first().displayName}
Name Failed Passed Skipped Total
${hudson.Util.xmlEscape(packageResult.getName())} ${packageResult.getFailCount()} ${packageResult.getPassCount()} ${packageResult.getSkipCount()} ${packageResult.getPassCount() + packageResult.getFailCount() + packageResult.getSkipCount()}
${hudson.Util.xmlEscape(test.getFullName())} ${test.getStatus()}
${hudson.Util.xmlEscape(failed_test.getFullName())} (Age: ${failed_test.getAge()})

<% } %> <% try { def aggregationAction = it.getAction("io.jenkins.plugins.analysis.core.model.AggregationAction") if ( aggregationAction != null ) { %> <% aggregationAction.getTools().each { tool -> %> <% } %>
${hudson.Util.xmlEscape(aggregationAction.getDisplayName())}
Tool Low Normal High Error
${hudson.Util.xmlEscape(tool.getName())} ${tool.getLowSize()} ${tool.getNormalSize()} ${tool.getHighSize()} ${tool.getErrorSize()}

<% } } catch(e) { // we don't do anything } %> <% if ( build.result == hudson.model.Result.FAILURE ) { %> <% build.getLog(100).each() { line -> %> <% } %>
CONSOLE OUTPUT
${org.apache.commons.lang.StringEscapeUtils.escapeHtml(line)}

<% } %>