Bulk change bamboo plan labels

We have a huge amount of plans in bamboo (400+) and I'd like to be able to give them all labels so we can use the filtering functionality better. I don't see a way of doing this as a bulk operation however.

I saw in the rest api documentation that you can change the plan-build labels and I altered this call to try and change the plan labels. The command worked ok. Retrieving the labels after the change showed the label was added but this wasn't reflected on the web ui. (I added the label "test" and it did show up in the filter options but the plan didn't show the label and when the filter was selected there were zero plans shown)

Curl command I used:

curl -k -v -X POST --user <USER>:<PASSWORD> "<BAMBOO-URL>/rest/api/latest/plan/<PLAN-NAME>/label" -d "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><label name=\"test\"/>" -H "Content-type: application/xml"

Any ideas on an alternative to going in to 400+ plans and adding labels one by one?

6 answers

After further investigation, this command above actually works. But it doesn't show up on the web front end until after a reboot of the bamboo service.

Hi Patrick,

I wonder if editing labelled plan configuration (and saving it) would be enough for Bamboo to start displaying the labels in the UI. Would you be able to check that on a single plan? I think you've encountered a bug (obviously) but above test could narrow down where the problem exists in the Bamboo code...


Yes, the manual editing of a plan and adding a label on the UI works fine. Using the rest api, I can see the change going in fine in to the buildresultsummary_label database table. Except it needs a restart of bamboo for that change to be picked up on the UI.

As I said, it shows up in the list of labels to filter but it doesn't seem to be attached to the plan.

What would happen if you:

1) used REST to add a 'test' label to a plan that has no such label.

1a) check in the UI if the 'test' label appear - we expect it won't appear, while it will be in the db table.

2) edited configuration of that plan and saved it (for example changed the plan name from "Plan name" to "Plan name2")

3) would the 'test' label appear in the UI?

Yes, that worked.

1. Added "test" label with REST

2. UI does not display label

3. Changed plan configuration name

4. Saved. Label now displays

Cool, thanks for checking that. I've raised https://jira.atlassian.com/browse/BAM-11960 for that bug. Feel free to add yourself as a watcher to it if you'd be interested in solving the issue.


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

102 views 3 4
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you