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
4,300,847
Community Members
 
Community Events
165
Community Groups

Is it possible to make a call to the bamboo api from a plan?

I would like to know if it is possible to call the Bamboo api from a task (for example, Script type), the important thing is that it can be called with the credentials of the user who is logged into bamboo.


Is there a variable with the credentials of the user who is logged into bamboo?

or is it necessary to use plan level variables with credentials to do this?

1 answer

Hi, yep.

There's no problem with it.

Refer to this to learn more about api.

I call it from PowerShell scripts with invoke-webRequest under service accounts creds. I don't know, unfortunately, about any way to extract user's creds from the runtime. However, our deployment is old enough - check latest  releases documentation of the Bamboo.

Don't forget to prepare credentials correctly if you will be using PowerShell.

Important: don't forget to append a call with "?os_authType=basic" or you requests will fail.

Example:

$url = "https://bamboo.someprovider.com/rest/api/latest/result/$projectKey-$buildKey-" + "$buildNo" + "?os_authType=basic&expand=artifacts"

I don't like idea to use Bamboo secret variables to store passwords and as I remember it was causing issues when I was preparing creds for PowerShell requests. I'm using Windows Credentials Manager to store service account credentials instead of Bamboo offering (creds update will occur with standard automation from the IT/security side and I will invoke them securely to the script).

Suggest an answer

Log in or Sign up to answer
TAGS
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...

969 views 3 8
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