How can I get deploymentResultId for specific deployment?
Hello @Dmitrij Kultasev
I hope you are doing great!
Let me share a couple of steps you can use to get this information knowing just the plan associated with a given deployment.
curl -u <USER>:<PASSWORD> \ -X GET -p <BAMBOO_URL>/rest/api/latest/deploy/project/forPlan?planKey=<PLAN-KEY> \ | jq -r '.[] | "Name: " + .name + "\tdeploymentId: " + (.id|tostring)'
Name: <DEPLOYMENT_NAME> deploymentId: <DEPLOYMENT_ID>
curl -u <USER>:<PASSWORD> \ -X GET -p '<BAMBOO_URL>/rest/api/latest/deploy/project/<DEPLOYMENT_ID>' \ | jq -r '.environments[] | "Name: " + .name + "\tenvironmentId: " + (.id|tostring)'
Name: <ENVIRONMENT_NAME> environmentId: <ENVIRONMENT_ID>
curl -u <USER>:<PASSWORD> \ -X GET -p '<BAMBOO_URL>/rest/api/latest/deploy/environment/<ENVIRONMENT_ID>/results' \ | jq -r '.results[] | "Version" + .deploymentVersionName + "\tdeploymentResultId:" + (.id|tostring)'
Version: release-XX deploymentResultId: <ENVIRONMENT_RESULT_ID>
I hope that helps.
@Daniel Santos that's not what I needed. That's the ID I'm looking for to be used in /deploy/result/{deploymentResultId} .
I might go wrong direction, but I want to find last successful deployment for specific plan.
Hi @Dmitrij Kultasev
Please give the steps above a chance. They will give you exactly a list of deploymentResultIds for a given environment.
This is the relationship between the plan and a given deploymentResultId:
I just tested these steps again. They should give you exactly what you want.Please let me know if you face any issues to follow them.
yes, that works. Sorry.
It looks like you're new here. Sign in or register to get started.