Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to show information from Bamboo deployments?



Currently I'm searching the way of how to gather information like currently deployed (released) version per each environment from Bamboo and show it in Jira board.

Seems, it's can be done through API requests to Bamboo deployments and gathering required information and then transform it somehow and show via Jira custom fields (or another) plugin.

Has anyone has done it before or has some ideas for better (and easier) implementation of this?



1 answer

2 votes

Hi @Sentinel

Thank you for raising this question. It is a challenging one =]

It is difficult to find people with the right skills in both apps to do solve the whole puzzle, but I can share with you the Bamboo part.

This is an example of how you could get the deployment name and the deployment id for a given plan key. You may need it if you don't know what is the deployment id from which you want to gather the data. If you could get the plan key from Jira, this would allow you to move forward to deployments.

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)'

Keep in mind that the result is filtered with jq (command-line JSON processor).

The second example involves a method to gather the environment ids. This one will allow you to get data from specific environments for the deployment you got from the step above.

curl -u <USER>:<PASSWORD> \
-X GET -p '<BAMBOO_URL>/rest/api/latest/deploy/project/<DEPLOYMENT_ID>' \
| jq -r '.environments[] | "Name: " + .name + "\tenvironmentId: " + (.id|tostring)'

The last example will allow you to get all the deployment results for a given environment. You will be able to filter them using a similar method as shared for the examples above:

curl -u <USER>:<PASSWORD> \
-X GET -p '<BAMBOO_URL>/rest/api/latest/deploy/environment/<ENVIRONMENT_ID>/results'

That is the way you can walk from a plan key to a deployment result using REST APIs. Now you will still need to check the Jira side of things. I don't have a lot of experience in Jira to help you with this one, but if I were you I would start checking the Jira REST API.

It is also important to know how you want this to be triggered. Do you expect the update to happen after a Bamboo event or after a Jira event? That will affect when the REST calls will be called and the sequence of events to populate the Jira issue.

I hope the information shared here at least help you to understand the problem better so you can build a strategy to solve it in case no other community member come with a simpler way to approach it.

Hi Daniel,

Decided to pick another solution - python with selenium webdriver package to grab content from deployments page. After some transformation the output html file placed in http server (or you can use docker+nginx, copying files into container).

Finally, with a help of Custom Content plugin for Jira inserted http link to server (where my grabbed deployments are kept). Now my custon dashboard with Custom Content plugin shows latest deployments like in Bamboo.

P.S. BTW you need to re-run script regularly to renew deployments information.

Like Daniel Santos likes this

Hi @Sentinel,

That is a great solution and thank you for taking the time to share it here.
You found your own way to solve the problem and that is awesome!

Have a good one!

Like Sentinel likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

57 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you