In this example, use a job to regularly add a comment to all build plans that are currently failing. For example, check for builds that have been in a failing state for more than one day.

Then, configure Bamboo build plan notifications so that when the comment is added, a notification is then sent to Slack.

Adding the Job

  1. Navigate to the Jobs page.

  2. Select Add New Item and then Build SLA Reminder.

  3. Fill in the details as shown:
    failed builds scripted job

    Make sure to use whichever user you plan to run this job as, rather than Admin. The Cron Expression in this case means "Run at half past midnight every day".

Once the job has been saved, you should start to see comments like the following screenshot start appearing on failing build plans.

failed build comment

Configuring the Bamboo Notifications

Now that the job is monitoring the failing builds and commenting on those that have not been fixed within a specified amount of time (one day in this example), the relevant build plan notification settings can be configured.

  1. Enter Event as Comment Added.

  2. Enter Recipient Type as Slack.

  3. Obatin the Slack Webhook URL from your Slack administrator.

  4. Enter the Room Name as the name or ID of the Slack channel you wish the notifications to appear in.
    slack notification config

The Comment Added notification type is only available at the project plan level. Configure this notification for each of the project plans you are interested in.

Once the above Slack notification is configured, you should now start receiving Slack notifications like the following:

The Slack notification:

slack notification result