How to find Changeset IDs included in Deployment Versions
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
This article will show how to find the last Repository Changeset – by commit ID or hash – included in a given deployment version using a SQL query.
Solution
Solution
To list Changeset IDs for all repository types
1
2
3
4
5
6
7
8
9
SELECT dv.NAME AS "Version",
dp.NAME AS "Deployment Project",
de.NAME AS "Deployment Environment",
dvc.CHANGESET_ID AS "Commit Hash"
FROM DEPLOYMENT_PROJECT dp
JOIN DEPLOYMENT_VERSION dv ON (dp.DEPLOYMENT_PROJECT_ID = dv.PROJECT_ID)
JOIN DEPLOYMENT_VERSION_CHANGESET dvc ON (dv.DEPLOYMENT_VERSION_ID=dvc.DEPLOYMENT_VERSION_ID)
JOIN DEPLOYMENT_ENVIRONMENT de ON (de.PACKAGE_DEFINITION_ID = dp.DEPLOYMENT_PROJECT_ID)
WHERE dv.NAME = '<version name>';
To list only changesets/hashes for one Repository Type
Repository Types
Repository Type | Plugin Key |
---|---|
Git | com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:gitv2 |
SVN | com.atlassian.bamboo.plugin.system.repository:svnv2 |
Bitbucket Server 4.0+ | com.atlassian.bamboo.plugins.stash.atlassian-bamboo-plugin-stash:bbserver |
Stash | com.atlassian.bamboo.plugins.stash.atlassian-bamboo-plugin-stash:stash-rep |
GitHub | com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:gh |
Bitbucket Cloud | com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-bitbucket:bbCloud |
Perforce | com.atlassian.bamboo.plugin.system.repository:p4 |
CVS | com.atlassian.bamboo.plugin.system.repository:cvs |
Mercurial | com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-mercurial:hg |
1
2
3
4
5
6
7
8
9
10
11
SELECT dv.NAME AS "Version",
dp.NAME AS "Deployment Project",
de.NAME AS "Deployment Environment",
dvc.CHANGESET_ID AS "Commit Hash"
FROM DEPLOYMENT_PROJECT dp
JOIN DEPLOYMENT_VERSION dv ON (dp.DEPLOYMENT_PROJECT_ID = dv.PROJECT_ID)
JOIN DEPLOYMENT_VERSION_CHANGESET dvc ON (dv.DEPLOYMENT_VERSION_ID=dvc.DEPLOYMENT_VERSION_ID)
JOIN DEPLOYMENT_ENVIRONMENT de ON (de.PACKAGE_DEFINITION_ID = dp.DEPLOYMENT_PROJECT_ID)
JOIN VCS_LOCATION vl ON (dvc.VCS_LOCATION_ID = vl.VCS_LOCATION_ID)
WHERE dv.NAME = '<version name>'
AND vl.PLUGIN_KEY = '<plugin key>';
Sample Output
Version | Deployment Project | Deployment Environment | Commit Hash |
---|---|---|---|
release-1 | Test Deploy 1 | TestEnv 1 | 115f848562edd456ec110429468272a7dfe92eb4 |
release-1 | Test Deploy 2 | stg | ecbbc9ffe9d9a329bfe28e1bd414102868cf3215 |
release-1 | Test Deploy 3 | Deployment | ecbbc9ffe9d9a329bfe28e1bd414102868cf3215 |
Was this helpful?