How to retrieve which commit hashes are included in a expired or deleted Bamboo build

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

After a build result is expired or deleted from Bamboo, it's not possible to retrieve which were the commits of those builds.

However if the build is consuming a Bitbucket repository the information is still available in Bitbucket's database.

Environment

This information available only for Bamboo plans that consume Bitbucket server/DC repositories.

Solution

Using the following SQL statement it's possible to retrieve all builds that contained a specific commitID:

1 2 3 4 5 6 7 8 9 10 11 12 SELECT BBS.commit_id, BBS.name, BBS.build_key, BBS.build_number, BBS.created_date, BBS.updated_date, BBS.ref FROM public.bb_build_status BBS WHERE BBS.commit_id LIKE '%6afb46fde71%'

ℹ️ Substitute 6afb46fde71 with the commit id and the results will display all the builds associated with that commit id.

Using the following SQL statement it's possible to retrieve all commits that contained a specific build key:

1 2 3 4 5 6 7 8 9 10 11 12 SELECT BBS.commit_id, BBS.name, BBS.build_key, BBS.build_number, BBS.created_date, BBS.updated_date, BBS.ref FROM public.bb_build_status BBS WHERE BBS.build_key LIKE '%PLAN-KEY%'

ℹ️ Substitute PLAN-KEY with the plan key

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.