Notification Type Module

Available:

Bamboo 2.2 and later

On this page:

Description

The NotificationType module identifies your custom notification. Users will be able to select this from the drop down menu and provide any configuration information you require. This class is also responsible for determining whether the notification criteria is met (e.g did the build fail?).

NotificationTypes can be scoped to determine where it can be configured.  There are three options (though poorly named):

  • Chain - For Plan level notifications
  • Plan - for Job level notifications
  • System - for global notifications (configured in the administration section of Bamboo)

If you don't provide a scope, it will default to a Job level notification. Also, note that whilst there are Job and Plan level notifications, they are both configured at the plan level.  Job notifications will generally apply to all jobs within the Plan.

For more information on building a completed Notification Plugin see Building a Notification Plugin

Interface

Notification Types must implement the com.atlassian.bamboo.notification.NotificationType interface. There is an abstract class com.atlassian.bamboo.notification.AbstractNotificationType which you can extend that implements a lot of these methods for you.

Sample Module Descriptor

 <notificationType key="buildCompleted.allBuilds" name="All Jobs Completed" weight="40">
    <description>Notification sent for every job that finishes building</description>
    <scope>plan</scope>
  </notificationType>
 <notificationType key="chainCompleted.allBuilds" name="All Builds Completed" class="com.atlassian.bamboo.notification.chain.AllChainNotificationType" weight="10">
    <description>Notification sent for every fully completed build</description>
    <scope>chain</scope>
  </notificationType>
  <notificationType key="buildHungSystem" name="Job Hung" class="com.atlassian.bamboo.notification.buildhung.BuildHungNotificationType" weight="80">
    <description>Notification sent for any job that has hung while building. Can be configured globally and per plan</description>
    <scope>system</scope>
  </notificationType>
Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport