Plan import is blocked to prevent deleting your plan notifications silently with Bamboo Specs
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When pushing a Bamboo Spec to the Bamboo Server and the plan already exists with notifications, Bamboo Specs will stop the push and report the following exception:
1
com.atlassian.bamboo.specs.api.exceptions.BambooSpecsPublishingException: An error occurred while publishing plan BAMBOO-SPEC: 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
Environment
Prior to the Bamboo version 7.0
Cause
The publish has found an existing plan with the same key as the plan you are trying to publish and this plan has notifications configured which would be entirely removed by the definition you're publishing. As a safe-guard against this silent notification deletion, Bamboo Specs validation is stopping the publish.
Workaround
Option 1
Upgrade to Bamboo version 7.0 or later where this validation has been removed. Simply not specifying any notifications will result in all notifications being removed from the plan. If you want to retain existing notifications, make sure they are defined within your Bamboo Spec.
Option 2
If you are sure you want to remove all notifications from the existing plan (and that you're publishing to the correct plan key), you can add .noNotifications()
to your Plan object in the Spec to override the validation.
Example:
1
2
3
4
5
6
7
8
9
10
11
Plan plan = new Plan(new Project()
.key(new BambooKey("SPEC"))
.name("SPEC"),
"RSS",
new BambooKey("RSS"))
.noNotifications()
.pluginConfigurations(new ConcurrentBuilds()
.useSystemWideDefault(false)
.maximumNumberOfConcurrentBuilds(4))
.stages(new Stage("Default Stage")
(...)
Was this helpful?