How to fetch Bamboo agent build success percentage via DB query

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The steps outlined on this article are provided AS-IS. This means we've had reports of them working for some customers — under certain circumstances — yet are not officially supported, nor can we guarantee they'll work for your specific scenario.

You may follow through and validate them on your own non-prod environments prior to production or fall back to supported alternatives if they don't work out.

We also invite you to reach out to our Community for matters that fall beyond Atlassian's scope of support!

The purpose of this page is to fetch the success rate of all the agents in Bamboo via DB query. Currently this can be seen on the GUI under agent summary page for individual agents as below

(Auto-migrated image: description temporarily unavailable)

Environment

All supported version of Bamboo

Solution

Below query has been written which queries the below 2 tables to extract the results

1) BUILDRESULTSUMMARY - This table contains the details related to the build results

2) QUEUE - This table contains the details related to the agent

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SELECT Q.TITLE AS Agent_Name, COUNT(DISTINCT BRS1.BUILDRESULTSUMMARY_ID) AS Total_Builds, COUNT(DISTINCT BRS.BUILDRESULTSUMMARY_ID) AS Total_Successful_Builds, COUNT(DISTINCT BRS.BUILDRESULTSUMMARY_ID) * 100 / COUNT(DISTINCT BRS1.BUILDRESULTSUMMARY_ID) AS Agent_Successful_Percentage FROM BUILDRESULTSUMMARY BRS, BUILDRESULTSUMMARY BRS1, QUEUE Q, QUEUE Q1 WHERE BRS.BUILD_AGENT_ID = Q.QUEUE_ID AND BRS.BUILD_AGENT_ID = Q1.QUEUE_ID AND BRS.BUILD_STATE = 'Successful' AND BRS1.BUILD_AGENT_ID = Q.QUEUE_ID AND BRS1.BUILD_AGENT_ID = Q1.QUEUE_ID GROUP BY Q.TITLE

Please note the above query has been test successfully in PostgreSQL DB and might need modifications for other DB types

Results :

(Auto-migrated image: description temporarily unavailable)
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.