Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How do I get the build number used for a deployment release using REST API?

I am trying to use the Bamboo REST API to get the build number used for a specific deployment release. Using "/deploy/projectVersioning/{deploymentProjectId}/variables" returns the variables defined for the project but not the runtime variables for a specific version such as the build number. I thought using "/deploy/version/{deploymentVersionId}/status" would return the build number but it did not. Is there another API (or sequence of API calls) that can provide this information?

1 answer

1 accepted

0 votes
Answer accepted

Hi @Shaun Chung, you can try  {bamboo instance}/rest/api/latest/deploy/project/{deploymentProjectID}/versions

The result is a list of releases for the deployment proyect and each release is related to a build plankey.


Omar H.

Thanks for the suggestion but when I try that, all that is returned is an array of version information that does not contain anything about the build plan (other than the branch name). I would like to get the build result number the release is related to. Here is what I get back for each version:

"id": 28344360,
"name": "1.0.121",
"creationDate": 1543871749566,
"items": [],
"operations": {
"canView": false,
"canEdit": false,
"canDelete": false,
"allowedToExecute": false,
"canExecute": false,
"allowedToCreateVersion": false,
"allowedToSetVersionStatus": false
"planBranchName": "release/Sprint15",
"ageZeroPoint": 1543871749847

Should I be seeing something in the items array? I am running Bamboo 6.5.1 if that makes a difference. Ultimately I am looking to programmatically  get the same commit and issue information that is displayed on the release screen.

@Shaun Chung I understood your question, I had the same needs and I implemented a workaround, on the build pland I created an artifact (.txt file) with general build information and with this item (artifact) the rest end point above, show the items array in this array I get build result key that I needed.

I hope that can help you




Thanks for the workaround. I'll try using it. We use Artifactory to store our artifacts so nothing is shared between the builds and deploys that is why I never saw anything in items. It seems strange that the data would only be in the artifact info and not part of the release/version information.

Like talleym likes this

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events