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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How can I copy a toplevel page from one space to another?



I am trying desperately to copy a toplevel page from one space to another, but I seriously don't understand or find the API mechanism for it. What I am currently doing is:

ListBuilder<Page> lsbPages = pgmgr.getTopLevelPagesBuilder(srcSpace)

for(int i=0; i<lsbPages.getAvailableSize(); i++){
Page page = lsbPages.getPage(i, 1).get(0)

Page newpage = (Page) page.clone()
//Page newpage = (Page) page.copyLatestVersion()


pgmgr.movePageToTopLevel(newpage, tgtSpace)
//pgmgr.saveContentEntity(newpage, null)
//pgmgr.saveContentEntity(newpage, page, null)

but all it does is nothing... I either don't know if the cloning procedure is correct or if I need to use something else and I feel like there is also something missing to store the page correctly, but I have no clue what and the API docu is not really helpful. Currently I am just guessing. It is way different from what I am used to in Jira...

The only things I can find are about copying when there is already a page, but I am looking for creating basically a new page at top level (ideally a clone).

Can someone point me into the right direction? Was checking for sources the entire day, but no luck.

1 answer

0 votes
Helmy Ibrahim _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Sep 01, 2022

Hi Michael,

The method movePageToTopLevel will not actually move/copy the page to another space. It would only order the page in a page tree.

We have a built-in script to copy a page tree from one space to another: Copy Page Tree

I hope this helps! 


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events