If deletion service is called using immutable representation of a plan branch, the stages of the master plan are marked for deletion, which is incorrect.
Important: This problem only happens if plan branches are removed programmatically, by a plugin. Users using built-in Bamboo functionality are not affected.
- Install plugin that calls deletionService.deletePlan(ImmutablePlan plan). Argument must not be of type ImmutablePlanBranchImpl (must be really immutable branch). (For instance: https://github.com/mibexsoftware/plan-branch-terminator)
- Do whatever is required for a plugin to be triggered (in case of plan-branch-terminator, it's removing branch from Bitbucket Server)
- Wait for the deletion service to run.
Branch is removed. Master plan and other branches are intact.
Message like this can be seen in the logs and afterwards stages and jobs of the master plan are removed
- disable the plugin until the bug is fixed
- modify the plugin it so that it doesn't call deletionsService using 'ImmutablePlanBranch'. Use mutable object instead, like this: