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

Bulk move pages based on last modified


We recently installed power scripts add on in our confluence environment in preparation for a cleanup.

One item on our list is to move all pages that were last modified on or before 2015 are to be moved to a temporary space for about 6 months which afterwards would be deleted if none of the pages were claimed or screamed for.

I'm wondering if we can use power scripts for this and if possible what would the script look like (not being a developed or coder I'm a bit of a fish out of water here).

Thanks in advance.

1 answer

0 votes

Hello @Kathryn Smith ,

Create a space for keeping all archived pages. Get the id of the home page of this space.

Then you could create a script like this:

number archiveSpacePageId = 111011;

for (string s in getAllSpaces()) {
for (number p in selectPages("space = " + s)) {
if (p.updated < "2015-01-01") {
movePage(p, archiveSpacePageId);;

 archiveSpacePageId is the id of the home page of the space, which will keep all archived pages.

Wow thanks @Alexey Matveev _Appfire_ .

I do apologise. Is there a way this script to be altered to target a specific space to move pages from that were last modified 2015-01-01 rather than all spaces. EG: i have a space called 7. TRUCKS - can I test this script from this space to the archive space?

Annotation 2020-07-23 091940.jpg

I unfortunately I do not have a test confluence environment to test this out in and if i moved all the pages that this script would target then i would be impacting a live environment and i might lose my job!

Thanks you so much aswell - super appreciative.


@Kathryn Smith ,

You can write a script like this:

number archiveSpacePageId = 111011;
string sourceSpace = "7. TRUCKS";

for (number p in selectPages("space = " + sourceSpace)) {
if (p.updated < "2015-01-01") {
movePage(p, archiveSpacePageId);;

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

How we use Jira Service Management for our recruitment process! - Part 2

It is never about setting up a process and being done with it. Rather, the focus should always be on optimizing it for the best outcomes. Thus, we didn’t stop at setting up JSM for our recruitment pr...

182 views 0 5
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