Hi Team,
Can you please help me to get rest api to enable/disable a stages through api call in bamboo. Please find the attached screenshot.
Thanks & Regards,
Madhu Balineni
Hello @Madhu
You are actually looking for a way to control a Job status, not a Stage. Stages can't be disabled by design.
Unfortunately, no REST API endpoint would allow you to manage a Plan structure that way. For that, Bamboo uses Plan Specs to manage a Plan structure.
If you want to automate that, please export the Plan as Java Specs and use Maven to upload a new Plan with a disabled Job using Java Specs; you can also use Repository Stored Specs.
Use the tutorial below to create your first Bamboo Specs Maven project. When creating the Plan file, fill it with the content from the exported Plan you have done before, as instructed in the previous paragraph.
Then on your Specs code, modify the Job status to enabled(false) and publish it back to Bamboo.
.stages(new Stage("Default Stage")
.jobs(new Job("Build",
new BambooKey("BLD1"))
.enabled(false)
Sincerely,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.