/
How to add labels to all builds in a plan using Bamboo Command Line Interface (CLI)
How to add labels to all builds in a plan using Bamboo Command Line Interface (CLI)
This article explains how to add labels to all the builds in a particular plan using the Bamboo Command Line Interface (CLI) app.
Instructions
Use the runFromBuildList action with the addLabels action to add labels to all the builds under the specified Bamboo plan.
Execute the following CLI action:
--action runFromBuildList --plan "TR-TP" --common "-a addLabels --build "@build@" --labels label1"
For this example, the output of the action is as follows:
Run: -a addLabels --build TR-TP-10 --labels label1 'label1' labels were added to TR-TP-10. Run: -a addLabels --build TR-TP-9 --labels label1 'label1' labels were added to TR-TP-9. Run: -a addLabels --build TR-TP-8 --labels label1 'label1' labels were added to TR-TP-8. Run: -a addLabels --build TR-TP-7 --labels label1 'label1' labels were added to TR-TP-7. Run: -a addLabels --build TR-TP-6 --labels label1 'label1' labels were added to TR-TP-6. Run: -a addLabels --build TR-TP-5 --labels label1 'label1' labels were added to TR-TP-5. Run: -a addLabels --build TR-TP-4 --labels label1 'label1' labels were added to TR-TP-4. Run: -a addLabels --build TR-TP-3 --labels label1 'label1' labels were added to TR-TP-3. Run: -a addLabels --build TR-TP-2 --labels label1 'label1' labels were added to TR-TP-2. Run: -a addLabels --build TR-TP-1 --labels label1 'label1' labels were added to TR-TP-1. Run completed successfully. 10 actions were successful
The following screenshot shows how the plan changes after adding the labels:
In the mentioned actions:
- --plan value refers to a Plan key containing the project key.
- --build value refers to the Build key
- --labels value refers to the comma or blank-separated list of labels
It is recommended to test the commands in a non-production environment or run the action with--simulate parameter to verify the behavior before deploying.
Related content
How to add labels to current build with Bamboo task using Run CLI Actions in Bamboo
How to add labels to current build with Bamboo task using Run CLI Actions in Bamboo
More like this
How to add comments to a build plan with Bamboo Command Line Interface (CLI)
How to add comments to a build plan with Bamboo Command Line Interface (CLI)
More like this
Create Bamboo plans in bulk using Bamboo Command Line Interface (CLI)
Create Bamboo plans in bulk using Bamboo Command Line Interface (CLI)
More like this
How to get details of all Bamboo plans with Bamboo Command Line Interface (CLI)
How to get details of all Bamboo plans with Bamboo Command Line Interface (CLI)
More like this
How to add a stage to a plan with Bamboo Command Line Interface (CLI)
How to add a stage to a plan with Bamboo Command Line Interface (CLI)
More like this
Add branches for Bamboo plan in bulk using Bamboo Command Line Interface (CLI)
Add branches for Bamboo plan in bulk using Bamboo Command Line Interface (CLI)
More like this