bamboo rest api v6.9.0 end point /deploy/version/{deploymentVersionId}/status not working

florentcuret April 30, 2021

Hi,

we are using bamboo 6.9.0 build 60909 and we are using bamboo rest api.
I used this end point do collection versions for a deployment project
https://docs.atlassian.com/atlassian-bamboo/REST/6.9.0/#d2e3660
/rest/api/latest/deploy/project/481296387/versions
here is sample of the answer:
{
"id": 482377824,
"name": "branch:release-build:1-deployment:431",
"creationDate": 1619711358513,
"creatorUserName": "fcuret",
"items": [],
"operations": {
"canView": true,
"canEdit": true,
"canDelete": true,
"allowedToExecute": false,
"canExecute": false,
"allowedToCreateVersion": true,
"allowedToSetVersionStatus": true
},
"creatorDisplayName": "Florent Curet",
"creatorGravatarUrl": "https://secure.gravatar.com/avatar/e05c1feda2a86fb2b06d867ef761e48c.jpg?r=g&s=24&d=mm",
"planBranchName": "release",
"ageZeroPoint": 1619774322218
}
as an item part of a versions json array
all good with this call.

then I try to get the status related to this version id with
https://docs.atlassian.com/atlassian-bamboo/REST/6.9.0/#d2e811
/rest/api/latest/deploy/version/482377824/status
but the answer was
{"message":"Deployment version with id 482,377,824 not found","status-code":404}

In bamboo client, I think the equivalent call is
/deploy/viewDeploymentVersion.action?versionId=482377824
which works

Any idea what I am doing wrong with the /deploy/version/{deploymentVersionId}/status end point, please?

best regards and thanks for reading,

Florent Curet

1 answer

0 votes
hegyre March 13, 2023

Hello,

I have the exact same issue with Bamboo 7.2.10

Did you find a way to have it working ?

Florent Curet March 13, 2023

Hi, no I did not.
apparently I used

/deploy/environment/${ENVIRONMENT_ID}/results

as an alternative for the scenario I worked on.
have a look maybe it helps.

hegyre March 13, 2023

Hello @Florent Curet ,

Unfortunately I really need the /deploy/version/{deploymentVersionId}/status, as it's the only API (AFAIK) that indicates if a release has been approved or not (see this open ticket from 2014 (!) https://jira.atlassian.com/browse/BAM-15082

And I would like to script that so that when we deploy, we can check first if this has been approved and stop the deployment if it's not.

Florent Curet March 13, 2023

got it, interesting this approved/broken status on (release) versions. I never dive into this.
Unfortunately I do not know if there are any other end point providing such level of information. If you find out please post a reply...
May I ask who (validation team or product team...) or what (jira / ticket related to release management) is approving (release) versions in your company? Is there any end point to set a (release) version as approved or broken?

hegyre March 17, 2023

Hello @Florent Curet ,

The approval is done by a Delivery Lead, through the GUI, so that one person from the DevOps teams can start the deployment.

Yes endpoint to set approved/broken exists (you can look at the Bamboo rest api doc)

The script https://jira.atlassian.com/browse/BAM-15082?focusedCommentId=893172&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-893172 works and I was finally be able to programmatically check if the release is approved or not.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events