Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bulk change bamboo plan labels

Patrick Phelan July 25, 2012

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

0 votes
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2012

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!

0 votes
Patrick Phelan July 25, 2012

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

0 votes
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2012

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?

0 votes
Patrick Phelan July 25, 2012

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.

0 votes
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2012

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!

0 votes
Patrick Phelan July 25, 2012

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events