How to fetch the list of plans that are disabled from the Bamboo Data Center database

Still need help?

The Atlassian Community is here for you.

Ask the community

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

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!

Summary

The purpose of this article is to provide details of Bamboo plans which are in disabled state and fetch the corresponding latest build details. The suspended_from_building column tells us the state of the plan. If it is true then it is in disabled state. 

Environment

  • The solution was tested on Bamboo 9.2.7, but it will be applicable to other supported versions as well.
  • Tested on Postgress Database.

Solution

The below SQL can be used to fetch details of Bamboo plans which are in disabled state.


Note

The queries below were tested against a  Postgres database. If you use a different database management system, you’ll need to translate the query above into your DBMS’s syntax.

Query
SELECT P.PROJECT_KEY, BRS.PLAN_NAME , BRS.BUILD_KEY,
BRS.BUILD_NUMBER,
BRS.BUILD_STATE,
BRS.BUILD_DATE, BRS.BUILD_COMPLETED_DATE, B.suspended_from_building
FROM BUILDRESULTSUMMARY BRS , BUILD B , PROJECT P
WHERE BRS.BUILD_TYPE='CHAIN'
and BRS.BUILD_NUMBER = (SELECT MAX(BUILD_NUMBER)
FROM BUILDRESULTSUMMARY BRS1
WHERE BRS.BUILD_KEY = BRS1.BUILD_KEY)
and B.FULL_KEY= BRS.BUILD_KEY
and P.PROJECT_ID= B.PROJECT_ID
and B.suspended_from_building='true';

Last modified on Sep 25, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.