How to get a list of deployment environments that contain a specific variable from the Bamboo database

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!

This article will show you how to get a list of deployment environments that contain a specific variable from the Bamboo database.

Environment

Bamboo 7, 8 and 9

Solution

Use the following SQL to gather all deployment environments that contain a specific variable:

1 2 3 4 5 6 7 SELECT DP.NAME AS "DEPLOYMENT_PROJECT", DE.NAME AS "ENVIRONMENT" FROM DEPLOYMENT_ENVIRONMENT DE JOIN DEPLOYMENT_PROJECT DP ON DE.PACKAGE_DEFINITION_ID = DP.DEPLOYMENT_PROJECT_ID JOIN VARIABLE_DEFINITION VD ON DE.ENVIRONMENT_ID = VD.ENVIRONMENT_ID WHERE VARIABLE_KEY = 'variable_to_search' AND VARIABLE_VALUE = 'variable_value_to_search';

Change variable_to_search and variable_value_to_search for the variable name and value you want to search in the database for.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.