Plan import is blocked to prevent deleting your plan notifications silently with Bamboo Specs
The following error appears when attempting to push your Bamboo Spec to the server:
An error occurred while publishing plan PROJ-PLAN: Plan import is blocked to prevent deleting your plan notifications silently. If you are confident that you want to delete all plan notifications, use com.atlassian.bamboo.specs.api.builders.plan.Plan.noNotifications method explicitly."
A plan with the same plan key that's specified in the Bamboo Spec already exists and has existing notifications configured. This Bamboo Spec that's being pushed has no notifications, so Bamboo Specs validation is letting you know that this push is going to delete all notifications on the plan.
Add the c
om.atlassian.bamboo.specs.api.builders.plan.Plan.noNotifications() method call to your Bamboo Specs plan definition. This will override the validation and remove all notifications from the existing plan once pushed. E.g:
Plan plan = new Plan(new Project() .key(new BambooKey("SPEC")) .name("SPEC"),"RSS",new BambooKey("RSS")) .noNotifications()
Alternatively, you could remove all notifications from this plan manually from the Bamboo UI at Plan Configuration >> Notifications before pushing the Spec again.