How to create confluence space automatically with blueprints?

We want to create confluence space automatically and the below code works fine. How to specify blueprint (Documentation space/knowledge space/Team space) type here  so that space is created based on the blueprint type?  

def UserAccessor userAccessor = (UserAccessor) ContainerManager.getComponent("userAccessor")

SpaceManager spaceManager = (SpaceManager) ContainerManager.getComponent("spaceManager")

List<Space> allSpaces = spaceManager.getAllSpaces();

 

spaceManager.createSpace("AAA","Example space","This is an example",tmp_id)

 

 

2 answers

Hi Vaasanthi,

I am not a developer in nature and I am also trying to figure out if i can create a page where users can request/create new spaces automatically.  Can you please help and give some direction if that is what you did?

Thanks!

Bryan

0 votes
Usman Khalid Atlassian Team Mar 08, 2018

Hi @Vaasanthi, There's an option of "Space Blueprints" within the Create space dialog. It creates a space with a customized homepage and sometimes include sample pages too.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,133 views 61 8
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you