What sort of data is available for the deployment email templates?

I'm trying to customize the deployment email templates, but i can't find good documentation to acomplish this. All documentation seems to be around Build Templates. Is there any documentation on was sort of metadata/variables are available for deployment templates?

 

 

1 answer

I'm assuming you are referring to Modifying notification templates?!

IIRC, similar to how the Freemarker ${buildSummary} variable basically exposes the resp. Java API BuildResultsSummary interface, the ${deploymentResult} variable basically exposes the resp. Java API DeploymentResult interface.

You can see this in action within Carolyn van Slyck's Bamboo Deployment Notifications, e.g. in template EmailSubject.ftl:

[#-- @ftlvariable name="deploymentResult" type="com.atlassian.bamboo.deployments.results.DeploymentResult" --]
[#-- @ftlvariable name="deploymentProject" type="com.atlassian.bamboo.deployments.projects.DeploymentProject" --]
[#-- @ftlvariable name="numFailures" type="Integer" --]
[#assign deployment=deploymentProject.name /]
[#assign release=deploymentResult.deploymentVersion.name /]
[#assign environment=deploymentResult.environment.name /]
${deployment} ${release}[#t]
[#if deploymentResult.deploymentState == "Successful"] was successfully deployed to ${environment} after ${numFailures} [#if numFailures = 1]failure[#else]failures[/#if].[#rt]
[#elseif deploymentResult.deploymentState == "Failed"] failed deploying to ${environment} (${numFailures} [#if numFailures = 1]times[#else]times[/#if]).[#rt]
[#else] stopped deploying to ${environment}[#rt]
[/#if]

For a Bamboo version x.y.z installation, you can inspect the built in Freemarker deployment notification templates within the following artifact (search for *.ftl):

<bamboo-install>/atlassian-bamboo/WEB-INF/lib/atlassian-bamboo-deployments-x.y.z.jar

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,568 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you