Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo Specs - Create new plan on existing project? Edited

How do I go about attaching new plans to existing projects? 

At the moment I'm getting: 

Exception in thread "main" com.atlassian.bamboo.specs.api.exceptions.BambooSpecsPublishingException: An error occurred while publishing plan APN-MODULES: Duplicate project name modules

thrown, which technically makes sense as that project does already exist. 

I can't find anything in the reference API or Java docs for how to create a plan on a project that has already been created. 

The method I'm using to create a new plan: 

    public static Plan createPlan(String planName, String planKey, String planDescription, String projectName, String projectKey) {

        Project project = new Project()
                .name(projectName)
                .key(projectKey);

        return new Plan(project, planName, planKey)
                .description(planDescription);
    }

Any help is much appreciated. 

3 answers

1 accepted

0 votes
Answer accepted

To add plans to an existing project you must set the OID on the project object.

.oid(new BambooOid("<PROJECT_OID>"))

You can get the OID by viewing an existing plan in the project "as Java specs".

That is observed to be true for Bamboo 6.4.1, but not necessary for newer versions of Bamboo like  6.6.1 (which is the one I tested).

Verified.  I've removed the OID from the project object on Bamboo 6.7.2 and the spec was successful.

I am on Bamboo 6.6.3 and it works fine without specifying the OID.

Like Daniel Santos likes this

On 6.5, I was able to use an existing plan by using name, key, and oid:

 

Project project() {
return new Project()
.name("project_name")
.key("project_key")
.oid(new BambooOid("project_oid"));
}
0 votes

Are you sure you didn't make mistake in project key?

What happens if you skip .name(projectName) from project definition?  (it should work if project with given key already exists)

@Marcin GardiasI'm having the same issues as @Chris Turner.  If I create a Project object using an existing name and key then I get a "Project with this name already exists" error.  I'm on Bamboo 6.4.1.

If I do not set the ".name" of the Project object, per your suggestion, I get a "Please enter a project name" error.

 

Is it possible to use Bamboo specs with an existing Bamboo project?

Thanks

Like Thomas Stepp likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

595 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you