TeamCity 5.1 Email template


I'm going to begin use TeamCity for our projects. It has a lot of very useful stuff.
But now I've faced with notification problem.
I want that every letter contains information about last 10 commit to svn.

I found here that I can use ${buildServer.getVcsHistory()} for my porposes.
But unfrotunately  I get following error:
[2011-02-07 14:57:27,180]   WARN - .notification.FreeMarkerHelper - Expression buildServer is undefined on line 27, column 3 in email/build_successful.ftl.

All others objects like build, buildType are available.

Could someone help me?

Comment actions Permalink

So I found solution for me. Now the notification email contains info about changed files:
I've just added new macro "build_all_changes" to common.ftl. And then insert reference to build_succesful.ftl and build_failed.ftl:  <@common.build_all_changes var.changesBean />
Probably it could help someone else ;)

<#macro build_all_changes bean>
  <#-- @ftlvariable name="buildType" type="jetbrains.buildServer.serverSide.SBuildType" --> 
  <#-- @ftlvariable name="bean" type="jetbrains.buildServer.notification.impl.ChangesBean" -->
  <#-- @ftlvariable name="webLinks" type="jetbrains.buildServer.serverSide.WebLinks" -->
    <#assign modNum=bean.modificationsNumber/>
    <#if (modNum > 0)>
        <#assign changesLink><a href='${webLinks.getViewChangesUrl(}'>${modNum} change<@plural modNum/></a></#assign>
        Changes included (${changesLink})<#if bean.changesClipped>,
        only ${bean.modifications?size} are shown</#if>.
      <#list bean.modifications as mod>
        <#assign pers><#if mod.personal>(personal build)</#if></#assign>
        <#assign description=mod.description/>
        <#if description?length == 0><#assign description='&lt;no comment&gt;'/></#if>
 <#assign modLink><a href='${webLinks.getChangeFilesUrl(, mod.personal)}'>${mod.changes?size} file<@plural mod.changes?size/></a></#assign>
          Change ${mod.displayVersion} ${pers} by ${mod.userName} (${modLink}):
 <#list mod.getFilteredChanges(buildType) as change>
 ${change.getRelativeFileName()} - ${change.getChangeTypeName()}

Comment actions Permalink

FYI, I posted on a similar question, ie how to increase the number from 10 changes in the email, and referenced this post, here;

Also thank you for your googleable post, possibly that is how I originally found how to add the changes!


Please sign in to leave a comment.