I have to include branch name and latest git commit SHA in TeamCity successful email template.
I've added these lines to the standard build_successful.ftl
email template file:
<#global body>
...
Commit: ${build.buildNumber}
Branch: ${build.branch.displayName}
...
</#global>
but got this email:
Commit: 77
Branch: [TEAMCITY TEMPLATE ERROR]
I've found that TC server side API model exposes these methods: http://javadoc.jetbrains.net/teamcity/openapi/8.0/jetbrains/buildServer/Build.html#getBuildNumber() http://javadoc.jetbrains.net/teamcity/openapi/8.0/jetbrains/buildServer/serverSide/Branch.html#getDisplayName()
I can't figure out how to obtain required info.
We are using:
- TeamCity 8
- git provider by JetBrains
- windows host
I've got a correct answer from official JetBrains support forum: