Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo email customization: how to get the build summary (in a failed build) in email

Hi,

We just upgraded to Bamboo 4.1.2 and would like to change the email of build failures to include the summary of the build error like when you go to Bamboo's build failure page (like below).

I've started to look at the notification customizations through Freemarker, but there's no documentation (that I can find) of all the Bamboo variables that are available. Could you tell me what those are?

Thanks

FROM BAMBOO:

Error Summary for PLANHERE

The job generated some errors, drill down into the full build log for more details.

The build error summary goes here <-- this is what i need in email

3 answers

Ping, any help here?

0 votes

You have com.atlassian.bamboo.event.BambooErrorEvent object stored accessible via "error". It should give you what you need.

Thanks, and how do I get the list of members of this object?

bmccoy Atlassian Team Jul 15, 2012

Its not very discoverable but the Javadocs for the Notification classes list the available data:

Plan Level Completed Notfiications: http://docs.atlassian.com/atlassian-bamboo/latest/com/atlassian/bamboo/notification/chain/ChainCompletedNotification.html

Job Level Completed Notifiations: http://docs.atlassian.com/atlassian-bamboo/latest/com/atlassian/bamboo/notification/buildcompleted/BuildCompletedNotification.html

Methods available on the Java objects are available in freemarker via the shortened syntax. e.g. .getPlanKey() -> .planKey

Unfortunately you can not access the error information in the plan level notifications. So You will only be able to do this for Job Notifications e.g:

[#list buildResult.buildErrors as error]
${error}<br/>
[/#list]

Thanks Brydie. I'll take a look at the links.

Referencing buildResult.buildErrors would give me the full list of errors or the error summary only like what the Bamboo summary page gives you (not the 'log' tab/page though)?

thanks

bmccoy Atlassian Team Jul 15, 2012

That bit of freemarker i grabbed directly from the bamboo summary page :)

So yes, just the errors.

Brydie, So are you saying that we cannot include job-level errors in the "All Builds Completed" email or any other build-level email? The build-level emails have a table listing job results. Does this mean I have to add a Job-level notification to the plan, and put your code in there? Do you know what template file and where? Also, what templates files are used? I've tried putting static text in various files and nothing shows up in the emails. We are using HTML plan/build emails. For now I am only interested in adding error detail (the stdErr messages) to the build failed email. Thanks for any help, Jeff

I just found this thread trying to add the Error summary from the results web page to the e-mail. This worked for me on 5.13:

Copy notificationCommonsHtml.ftl to BAMBOO_HOME\templates\notification-templates

Look for this line:

[#macro showFailingJobs buildSummary baseUrl]

This is where it displays info about the failed jobs.  I updated this section:

[#if jobResult.failed]
[@displayJobRow jobResult stageResult/]
[#assign failingJob = true /]
[#-- Added to show failed job error summary --]
<tr>
<td colspan="5"><strong>Error Summary:</strong><br/>
[#list jobResult.extraBuildResultsData.buildErrors as error]
${error}<br/>
[/#list]
</tr>
[/#if]

That adds the build summary error message after each failed job.

The API has changed a bit since the original response. The error data is now in ExtraBuildResultsData. Remember to restart Bamboo after you've edited the file.

Looking for the exact same thing.

Hi I am facing the same issue here. Can you help me with this.

bmccoy - This is quite urgent can you help us on this.

@bmccoy  - Could you help me to change notification templates in bamboo.

I have changed the coding but i couldnt do this.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.2 is here!

I'm happy to announce that Bamboo 7.2 has been released and it’s overflowing with awesome new features. This will be the last major Server release before the launch of Bamboo DC. Bamboo logs We...

438 views 5 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you