This article explains how to add the labels to all the build in a particular plan using the BambooCLI action runFromBuildList
Instructions
Use the runFromBuildList action along with addLabels to add the labels in all the build under the Bamboo plan.
Execute the below CLI action.
--action runFromBuildList --plan "TR-TP" --common "-a addLabels --build "@build@" --labels run2"
The output of the action:
Run: -a addLabels --build TR-TP-10 --labels run2 'run2' labels were added to TR-TP-10. Run: -a addLabels --build TR-TP-9 --labels run2 'run2' labels were added to TR-TP-9. Run: -a addLabels --build TR-TP-8 --labels run2 'run2' labels were added to TR-TP-8. Run: -a addLabels --build TR-TP-7 --labels run2 'run2' labels were added to TR-TP-7. Run: -a addLabels --build TR-TP-6 --labels run2 'run2' labels were added to TR-TP-6. Run: -a addLabels --build TR-TP-5 --labels run2 'run2' labels were added to TR-TP-5. Run: -a addLabels --build TR-TP-4 --labels run2 'run2' labels were added to TR-TP-4. Run: -a addLabels --build TR-TP-3 --labels run2 'run2' labels were added to TR-TP-3. Run: -a addLabels --build TR-TP-2 --labels run2 'run2' labels were added to TR-TP-2. Run: -a addLabels --build TR-TP-1 --labels run2 'run2' labels were added to TR-TP-1.
Refer to the below screenshot after adding the 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.