Hello, I am trying to create a Plan in Bamboo using specs but I everytime get the following error message:
[ERROR] Failed to execute goal com.atlassian.bamboo:bamboo-specs-runner:6.1.1:run (default-cli) on project bamboo-specs-tutorial: Execution default-cli of goal com.atlassian.bamboo:bamboo-specs-runner:6.1.1:run failed: java.lang.reflect.InvocationTargetException: An error occurred while publishing plan DEVOPS-TST: Could not parse key 'null' -> [Help 1]
and here the snippet of code:
public static void main(final String[] args) throws Exception {
BambooServer bambooServer = new BambooServer("https://bamboo.foo.com/bamboo");
Plan plan = new PlanSpec().createPlan();
bambooServer.publish(plan);
}
Project project() {
return new Project().key("DEVOPS");
}
Plan createPlan() {
return new Plan(
project(),
"TEST SPECS", "TST")
.description("Plan created from (enter repository url of your plan)");
}
Activating some TRACE logs I see the post that is
2017-10-23 11:44:34,425 INFO [BambooServer] Publishing plan DEVOPS-TST
2017-10-23 11:44:34,533 TRACE [RestHelper] Sending the following content to https://bamboo.foo.com/bamboo/rest/api/latest/import/plan via POST:
--- !!com.atlassian.bamboo.specs.util.BambooSpecProperties
rootEntity: !!com.atlassian.bamboo.specs.api.model.plan.PlanProperties
description: Plan created from (enter repository url of your plan)
enabled: true
key:
key: TST
name: TEST SPECS
oid: null
pluginConfigurations: []
dependenciesProperties:
childPlans: []
dependenciesConfigurationProperties:
blockingStrategy: NONE
enabledForBranches: true
requireAllStagesPassing: false
notifications: []
planBranchManagementProperties:
branchIntegrationProperties:
enabled: false
gatekeeper: false
integrationBranch: null
pushOn: false
createPlanBranch:
matchingPattern: null
trigger: MANUAL
deletePlanBranch:
removeDeletedFromRepository: false
removeDeletedFromRepositoryPeriod: !!java.time.Duration 'PT0S'
removeInactiveInRepository: false
removeInactiveInRepositoryPeriod: !!java.time.Duration 'PT0S'
issueLinkingEnabled: true
notificationStrategy: NONE
triggeringOption: INHERITED
project:
description: null
key:
key: DEVOPS
name: null
oid: null
repositories: []
repositoryStoredSpecsData: null
stages: []
triggers: []
variables: []
specModelVersion: 6.1.1
Am I missing anything here?