Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Scipting Labels in Bamboo (for historic artifacts)

Hi,

 

We are looking to implement the Bamboo Global Expiry policy, but we have been using the tool for a number of years now.

We need to retrospectively apply labels across historic artifacts chosen by our development teams, before we implement the Global Expiry Policy. 

Is there any pain free options for doing this? Scripts? Plugins? that would aid in applying labels across historic artifacts on mass?

Thanks

1 answer

You should be able to achieve this via the Bamboo REST API, which supports adding/removing labels from plans/builds - relevant resources are:

As usual, any REST client will do, I'm personally using the free edition of Postman to explore/test an API from the browser and HTTPie for the actual implementation from the command line.

The Bamboo REST API supports both XML and JSON representations, and I think the former is the default, so make sure to request JSON by specifying "Content-Type: application/json" if you prefer this nowadays easier to work with format.

 

@Steffen Opel _Utoolity_ I tried following the API doc and I am getting "HTTP Status 415 – Unsupported Media Type, The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource." even if I am passing proper json data with application/json content type.

Request:

curl -X POST -H “Content-Type: application/json” -H ‘authorization: Basic XXXXX‘ -d ‘{“name”:”UTWeekly”}’ https://<Bamboo URL>/rest/api/latest/result/{projectKey}-{buildKey}-{buildNumber}/label

Also tried witth Postman tool and got the same result.

<!doctype html><html lang="en"><head><title>HTTP Status 415 – Unsupported Media Type</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 – Unsupported Media Type</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unsupported Media Type</p><p><b>Description</b> The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.</p><hr class="line" /><h3>Apache Tomcat/8.5.39</h3></body></html>

Suggest an answer

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

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

190 views 4 6
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