Skip to content
Permalink
Browse files
Jenkins 46818 msg for text template (#160)
* Correc use of build.changeSets

Fixes wrong variable name in template
which was failing rendering of template.

JENKINS-38968

* Fixed changeSets in groovy-text.tempalte
  • Loading branch information
ssbarnea authored and davidvanlaatum committed Sep 14, 2017
1 parent 1d6cf43 commit 9cd308d946c18c5e861cef39e31b479acbdd5a30
Showing with 10 additions and 8 deletions.
  1. +10 −8 src/main/resources/hudson/plugins/emailext/templates/groovy-text.template
@@ -1,23 +1,25 @@
GENERAL INFO

BUILD ${build.result}
BUILD ${build.result ?: 'SUCCESSFUL'}
Build URL: ${rooturl}${build.url}
Project: ${project.name}
Date of build: ${it.timestampString}
Build duration: ${build.durationString}

<%
def changeSet = build.changeSet
if(changeSet != null) {
<%
def changeSets = build.changeSets
if(changeSets != null) {
def hadChanges = false %>
CHANGE SET
<% changeSet.each() { cs ->
<% changeSets.each() { cs_list ->
cs_list.each() { cs ->
hadChanges = true %>
Revision <%= cs.metaClass.hasProperty('commitId') ? cs.commitId : cs.metaClass.hasProperty('revision') ? cs.revision :
Revision <%= cs.metaClass.hasProperty('commitId') ? cs.commitId : cs.metaClass.hasProperty('revision') ? cs.revision :
cs.metaClass.hasProperty('changeNumber') ? cs.changeNumber : "" %> by <%= cs.author %>: (<%= cs.msgAnnotated %>)
<% cs.affectedFiles.each() { p -> %>
change: <%= p.editType.name %> <%= p.path %>
<% }
<% }
}
}
if(!hadChanges) { %>
No changes
@@ -30,4 +32,4 @@ CONSOLE OUTPUT
<% build.getLog(100).each() { line -> %>
${line}
<% }
} %>
} %>

0 comments on commit 9cd308d

Please sign in to comment.