I haven't tested this yet, but does this groovy template work into a 
pipeline? we used to have a groovy template like this before that did 
exactly what you propose. Since I wasn't sure how to select the groovy 
script (now I do, thanks to someone on this forum) and found how to use a 
jelly template before I converted everything to Jelly. The Jelly equivalent 
doesn't seem to work. I wonder if this is du to Jelly templating or the 
pipeline??? If this is the jelly, I will convert back to Groovy, else I 
will stick to Jelly, the template is cleaner IMO.

Thanks,
Jerome

I will try this and come back on this

On Wednesday, October 19, 2016 at 5:56:51 AM UTC-4, touseef wrote:
>
> May be this code might helped u as i had similar requirement but i 
> implemented it in groovy script
>
>
> <!-- CHANGE SET -->
> <% changeSet = build.changeSet
> if (changeSet != null) {
> hadChanges = false %>
> <h2>Changes</h2>
> <ul>
> <% changeSet.each { cs ->
> hadChanges = true
> aUser = cs.author %>
> <li>Commit <b>${cs.revision}</b> by <b><%= aUser != null ? aUser.displayName 
> :      it.author.displayName %>:</b> (${cs.msg})
> <ul>
> <% cs.affectedFiles.each { %>
> <li class="change-${it.editType.name}"><b>${it.editType.name}</b>: ${it.path} 
>                              </li> <%  } %> </ul>   </li> <%  }
>
>  if (!hadChanges) { %>  
>   <li>No Changes !!</li>
>  <%  } %>   </ul> <% } %>
>
>
> *And regarding the count u cant use this*
>
> *def size= build.changeSet.items.length*
>
>
> On Monday, 17 October 2016 20:36:33 UTC+5:30, [email protected] wrote:
>>
>> Hi,
>> I have use the Jelly template to re enable most of our email content, 
>> except 2 things I still cannot do, the revision change set and the warnings 
>> counts (the later is not too bad, we are moving to warnings as errors 
>> anyway).
>>
>> Any body have a way to access the scm changeSet into the pipeline 
>> emailext template?
>>
>> I tried without any luck:
>>
>>    - ${build.changeSet}
>>    - ${build.changeSets}
>>    - ${currentBuild.changeSets}
>>    - ${manager.build.changeSets}
>>    - ${manager.build.changeSet}
>>    
>> the console log are accessible with ${build.getLog()}
>> the artifacts are with ${build.artifacts}
>>
>> The warning were:
>> ${WARNINGS_RESULT()}
>> ${WARNINGS_COUNT()}
>> ${WARNINGS_NEW()}
>> ${WARNINGS_FIXED()}
>>
>> but now if used they generate a jelly parsing error.
>>
>> if any body have any tips or info on this I would be glad,
>> Thanks
>> Jerome
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c1095c48-4a2c-4ad3-9ad0-960148d0cac0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to