Hello,Is it possible to query Bamboo for the version number and import it automatically in Confluence? Thanks
Hi @Darko Cvetkovic,
You could make use of Bamboo's REST API to get the information you are looking for, however, it will require some effort from your end on parsing the information:
[{"id":1310721,"name":"My Deployment","description":""}]
{"id":1310721,"oid":"riqmph3qr9q9","key":{"key":"1310721"},"name":"My Deployment","planKey":{"key":"PROJ-PLAN"},"description":"","environments":[{"id":1409025,"key":{"key":"1310721-1409025"},"name":"Staging","description":"","deploymentProjectId":1310721,"operations":{"canView":true,"canEdit":true,"canDelete":true,"allowedToExecute":true,"canExecute":true,"allowedToCreateVersion":false,"allowedToSetVersionStatus":false},"position":0,"configurationState":"TASKED"}],"operations":{"canView":true,"canEdit":true,"canDelete":true,"allowedToExecute":false,"canExecute":false,"allowedToCreateVersion":true,"allowedToSetVersionStatus":false}}
{"expand":"results","size":1,"results":[{"deploymentVersion":{"id":1736705,"name":"release-2","creationDate":1523283725441,"creatorUserName":"admin","items":[{"id":1802241,"name":"TXT","planResultKey":{"key":"PROJ-PLAN-2","entityKey":{"key":"PROJ-PLAN"},"resultNumber":2},"type":"BAM_ARTIFACT","label":"TXT","location":"","copyPattern":"*.txt","size":5,"artifact":{"id":1671169,"label":"TXT","size":5,"isSharedArtifact":true,"isGloballyStored":false,"linkType":"com.atlassian.bamboo.plugin.artifact.handler.local:ServerLocalArtifactHandler","planResultKey":{"key":"PROJ-PLAN-2","entityKey":{"key":"PROJ-PLAN"},"resultNumber":2},"archiverType":"NONE"}}],"operations":{"canView":true,"canEdit":true,"canDelete":true,"allowedToExecute":false,"canExecute":false,"allowedToCreateVersion":true,"allowedToSetVersionStatus":true},"creatorDisplayName":"Admin Istrator","creatorGravatarUrl":"https://secure.gravatar.com/avatar/8bfb4e64c3987633d445e438bc6c5240.jpg?r=g&s=24&d=mm","planBranchName":"master","ageZeroPoint":1523283872697},"deploymentVersionName":"release-2","id":1966081,"deploymentState":"SUCCESS","lifeCycleState":"FINISHED","startedDate":1523283872694,"queuedDate":1523283872795,"executedDate":1523283873246,"finishedDate":1523283873434,"reasonSummary":"Manual run by <a href=\"http://localhost:8085/browse/user/admin\">Admin Istrator</a>","key":{"key":"1310721-1409025-1966081","entityKey":{"key":"1310721-1409025"},"resultNumber":1966081},"agent":{"id":196609,"name":"Default Agent","type":"LOCAL","active":true,"enabled":true,"busy":false},"operations":{"canView":true,"canEdit":true,"canDelete":true,"allowedToExecute":true,"canExecute":true,"allowedToCreateVersion":false,"allowedToSetVersionStatus":false}}],"start-index":0,"max-result":1}
In the example above "release-2" is what you are expecting in your latest inquire.
As my colleague mentioned, the trick is getting that output into a Confluence page. However, with the information already provided you should be good to go.
Hope it helps
Kind regards,
Rafael
Hey Darko,
Assuming you mean the version number of Bamboo (or did you mean version numbers for certain builds and deploys in your Bamboo?); it's certainly is possible.
Here's a few examples of API's that return the Bamboo version:
Now the trick is getting that output into a Confluence page. There's another community post which I've included below that has a few options which include some add-on suggestions for embedding REST API content in a page:
Or you could also use some AJAX in a custom HTML Macro like the below example:
<p id="bamVersion">Bamboo Version: </p> <script type="text/javascript"> $.get('http://bamboo:8085/rest/applinks/1.0/manifest.json', function(data, status){ $('#bamVersion').append(data['version']); }); </script>
Hope this helps.
Hello Jeremy and thanks for your answer,Sorry I did not provide more information about my question.What I wanted to say, is there a way to query Bamboo for some project that was build and to recive a version number of that project and on which production environment is deployed and later pull that information to the Confluence page?Thanks for your time
I would like to thank my colleague @Jeremy Owen for taking the time and replying to this inquire by up voting this thread.
Thank you both for your help and level of details on this issue.All the best, Darko
It looks like you're new here. Sign in or register to get started.