Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.
×Is it possible to add a requirement to existing tasks in multiple (200+) plans in bulk?
The use case: Bamboo is assigning agents to tasks that meet the minimum capabilities (eg Java) but run under a different OS (Linux vs Windows) which breaks legacy scripts, and I want to add a system.os requirement without having to manually edit every task.
Hello Wouter,
Welcome to Atlassian community.
I guess this feature request covers what you are looking for BAM-8476-Increase the number of autodetected agent capabilities (eg, operating system, platform, architecture, etc) . Unfortunately this has not been actioned in a long time.
From Bamboo GUI, you cannot edit the requirement of Jobs from 200+ plans in bulk. This can be achieved via Rest API. You can try to follow the below steps
1. List the full_key of all the Jobs using the below SQL query, this will list all the Jobs which you have in your system, probably some filters needs to be used to filter out the Job key which you need, let me know if you need any help there.
select DISTINCT(full_key), title, description from build join build_definition bd on build.build_id = bd.build_id where build_type = 'JOB' and requirement_set IS NOT NULL
2. For each one of the job keys you've retrieved, perform a POST call to the API endpoint to add the requirement for the "OS" capability to match "Linux". rest/api/latest/config/job/JOB_KEY/requirement. For example,
curl -H 'Content-Type: application/json' -u ADMIN:PASSWORD -X POST 'BAMBOO_URL/rest/api/latest/config/job/JOB_KEY/requirement' --data-raw '{"key":"OS","matchType":"EQUALS","matchValue":"Linux"}'
Let me know if this helps!
Regards,
Shashank Kumar
*please don't forget to Accept the answer if your query was answered**
Thank you for the information, that's what I was looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.