How to relate a release with deployment project, environment and build plan in Bamboo database

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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 page is to provide a DB query that will help link a release with a deployment project, deployment environment, and build plan in Bamboo 

The content on this page relates to platforms which are supported; however, the content is out of scope of our Atlassian Support Offerings. Consequently, Atlassian cannot guarantee support. Please be aware that this material is provided for your information only and you may use it at your own risk.

Building SQL statements for reporting purposes is not part of the Atlassian Support scope and this work is provided "as-is", on a best-effort basis. Queries may work better or worse than expected, your mileage may vary. It is up to each customer to analyze each query individually and understand if that is enough for their specific needs.

Environment

The query has been tested for PostgreSQL and MySQL DBMSs. 

Solution

SELECT DP.NAME         deploy_proj_name,
       DE.NAME         deploy_env_name,
       B.BUILD_ID      deploy_plan_id,
       DVP.PLAN_KEY    build_plan,
       DR.VERSION_NAME deployed_release
FROM   DEP_VERSION_PLANRESULTKEYS DVP
       JOIN DEPLOYMENT_VERSION DV
         ON DVP.DEPLOYMENT_VERSION_ID = DV.DEPLOYMENT_VERSION_ID
       JOIN DEPLOYMENT_RESULT DR
         ON DV.DEPLOYMENT_VERSION_ID = DR.VERSION_ID
       JOIN DEPLOYMENT_ENVIRONMENT DE
         ON DR.ENVIRONMENT_ID = DE.ENVIRONMENT_ID
       JOIN DEPLOYMENT_PROJECT DP
         ON DE.PACKAGE_DEFINITION_ID = DP.DEPLOYMENT_PROJECT_ID
       JOIN BUILD B
         ON DVP.PLAN_KEY = B.FULL_KEY 

Last modified on Oct 12, 2022

Was this helpful?

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