Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Hello.

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.

Kat

@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
TAGS
Community showcase
Published in Marketplace Apps & Integrations

New cloud apps roundup - June 2021

Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...

466 views 5 12
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