How to find historical deployment records in Bamboo

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

Summary

This article outlines a couple of methods you can use to find historical deployment records in Bamboo, even if the deployment releases have expired already.

Global expiry can be set to remove complete build & deployment results, build & release artifacts and all logs but it will never remove historical deployment records.

Environment

The solution has been validated in Bamboo 9.5 and Bamboo 9.6 but may be applicable to other versions.

Solution

Historical deployment records can be found in the Bamboo UI and the database even if deployment results, release artifacts, and logs have already been removed. You can use one of the following approaches to find historical deployment records:

Solution 1 – Bamboo UI

  1. Go to the Deploy > All Deployment Projects > select a Deployment Project > Releases tab.
  2. You'll see all of the historical records for that deployment project under the History section.

           

Solution 2 – Database/ SQL

The following select query will provide you with a list of historical records for a particular deployment project. The list will include details such as the deployment project name, release name, name of the release branch, the key of the plan associated to that release as well as its build number.

Bamboo 9.5 and earlier versions:

SELECT DP.NAME             AS deployment_project_name,
       DP.PLAN_KEY         AS plan_key,
       DE.NAME             AS deployment_environment,
       DV.NAME             AS release_name,
       DV.PLAN_BRANCH_NAME AS release_branch,
       DVPRK.BUILD_NUMBER  AS build_number,
       DVI.NAME            AS artifact_name,
       DR.DEPLOYMENT_STATE AS deployment_state,
	   DR.LIFE_CYCLE_STATE AS lifecycle_state,
       DR.STARTED_DATE     AS started_date,
	   DR.QUEUED_DATE      AS queued_date,
	   DR.EXECUTED_DATE    AS executed_date,
       DR.FINISHED_DATE    AS finished_date
FROM   DEPLOYMENT_PROJECT DP
       LEFT JOIN DEPLOYMENT_VERSION DV
              ON DP.DEPLOYMENT_PROJECT_ID = DV.PROJECT_ID
       LEFT JOIN DEPLOYMENT_RESULT DR
              ON DV.DEPLOYMENT_VERSION_ID = DR.VERSION_ID
       LEFT JOIN DEPLOYMENT_ENVIRONMENT DE
              ON DR.ENVIRONMENT_ID = DE.ENVIRONMENT_ID
       LEFT JOIN DEPLOYMENT_VERSION_ITEM DVI
              ON DV.DEPLOYMENT_VERSION_ID = DVI.DEPLOYMENT_VERSION_ID
       LEFT JOIN DEP_VERSION_PLANRESULTKEYS DVPRK
              ON DV.DEPLOYMENT_VERSION_ID = DVPRK.DEPLOYMENT_VERSION_ID
WHERE  DP.NAME = '<DEPLOYMENT_PROJECT_NAME>'
ORDER  BY deployment_project_name,
          started_date DESC NULLS LAST,
          finished_date,
          release_name DESC

(info) You'll need to replace <DEPLOYMENT_PROJECT_NAME> in the query with the actual deployment project name.

Bamboo 9.6 and later versions:

SELECT DP.NAME             AS deployment_project_name,
       DP.PLAN_KEY         AS plan_key,
       DE.NAME             AS deployment_environment,
       DV.NAME             AS release_name,
       DV.PLAN_BRANCH_NAME AS release_branch,
       DVPRK.BUILD_NUMBER  AS build_number,
       A.LABEL             AS artifact_name,
       DR.DEPLOYMENT_STATE AS deployment_state,
       DR.LIFE_CYCLE_STATE AS lifecycle_state,
       DR.STARTED_DATE     AS started_date,
       DR.QUEUED_DATE      AS queued_date,
       DR.EXECUTED_DATE    AS executed_date,
       DR.FINISHED_DATE    AS finished_date
FROM   DEPLOYMENT_PROJECT DP
       LEFT JOIN DEPLOYMENT_VERSION DV
              ON DP.DEPLOYMENT_PROJECT_ID = DV.PROJECT_ID
       LEFT JOIN DEPLOYMENT_RESULT DR
              ON DV.DEPLOYMENT_VERSION_ID = DR.VERSION_ID
       LEFT JOIN DEPLOYMENT_ENVIRONMENT DE
              ON DR.ENVIRONMENT_ID = DE.ENVIRONMENT_ID
       LEFT JOIN DEPLOYMENT_VERSION_ARTIFACT DVA
              ON DV.DEPLOYMENT_VERSION_ID = DVA.DEPLOYMENT_VERSION_ID
       LEFT JOIN ARTIFACT A
              ON A.ARTIFACT_ID = DVA.ARTIFACT_ID
       LEFT JOIN DEP_VERSION_PLANRESULTKEYS DVPRK
              ON DV.DEPLOYMENT_VERSION_ID = DVPRK.DEPLOYMENT_VERSION_ID
WHERE  DP.NAME = '<DEPLOYMENT_PROJECT_NAME>'
ORDER  BY deployment_project_name,
          started_date DESC NULLS LAST,
          finished_date,
          release_name DESC

(info) You'll need to replace <DEPLOYMENT_PROJECT_NAME> in the query with the actual deployment project name.

Example

In the example below, notice that the BSP-CASE plan had generated two artifacts used on release-7 (before that it only had one) and that release-1 and 2's dates are being reported as null because those Deployment results were already expired, so Bamboo no longer have that information

deployment_project_nameplan_keydeployment_environmentrelease_namerelease_branchbuild_numberartifact_namedeployment_statelifecycle_statestarted_datequeued_dateexecuted_datefinished_date
My Deployment projectBSP-CASEproductionrelease-7main9first_artifactSuccessfulFinished2023-02-07 16:47:44.6112023-02-07 16:47:44.6292023-02-07 16:47:44.7212023-02-07 16:47:45.024
My Deployment projectBSP-CASEproductionrelease-7main9second_artifactSuccessfulFinished2023-02-07 16:47:44.6112023-02-07 16:47:44.6292023-02-07 16:47:44.7212023-02-07 16:47:45.024
My Deployment projectBSP-CASEproductionrelease-6main8first_artifactSuccessfulFinished2022-10-29 15:24:19.4982022-10-29 15:24:19.5182022-10-29 15:24:19.7752022-10-29 15:24:05.661
My Deployment projectBSP-CASEproductionrelease-5main7first_artifactFailedFinished2022-10-29 15:22:53.412022-10-29 15:22:53.432022-10-29 15:22:54.0912022-10-29 15:22:13.514
My Deployment projectBSP-CASEproductionrelease-4main6first_artifactSuccessfulFinished2022-09-28 09:23:24.1412022-09-28 09:23:24.3812022-09-28 09:23:25.0962022-09-28 09:23:25.204
My Deployment projectBSP-CASEproductionrelease-3main5first_artifactSuccessfulFinished2022-07-22 14:35:13.4932022-07-22 14:35:13.5332022-07-22 14:35:13.72022-07-22 14:35:13.859
My Deployment projectBSP-CASEdevelopmentrelease-2main4first_artifact[ null ][ null ][ null ][ null ][ null ][ null ]
My Deployment projectBSP-CASEdevelopmentrelease-1main3first_artifact[ null ][ null ][ null ][ null ][ null ][ null ]


Last modified on Jul 15, 2024

Was this helpful?

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