You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
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()
newpage.setSpace(tgtSpace)
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.
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!
Cheers,
Helmy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.