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

This widget could not be displayed.

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.

This widget could not be displayed.

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...

cheers!

This widget could not be displayed.

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.

This widget could not be displayed.

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?

This widget could not be displayed.

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

This widget could not be displayed.

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.

cheers!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

170 views 1 3
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