Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automate Space Page Name Sort

Todd Winton
Contributor
June 2, 2025

We would like to automate the sorting of pages in a space by name.  This is something we are currently having to do manually.  I am not seeing how to do this with automation.  Is there a way to accomplish this?

2 answers

1 accepted

1 vote
Answer accepted
Darryl Lee
Community Champion
June 2, 2025

Hi @Todd Winton -

Unfortunately I don't currently see an easy way to do this.

There is an API to Move a page to a new location relative to a target page 

So in theory, you could create a scheduled task that sends a web request to the API to get a list of all the pages in your space, sort them by title, and then use send a using the Move API call above rearrange pages into the alphabetical order.

It's definitely a brute force approach though.

Darryl Lee
Community Champion
June 2, 2025

Haha, I posted too slow! What @Bill Sheboy said. :-}

Yeah, the iteration part would be tricky, because since the API is to move a page relative to another page, you'd need to refer to the prior pageId to put the next one after, and without global variables this doesn't work.

At least, that's what I'm thinking as I try to wrap my brain around the logic. 

2 votes
Bill Sheboy
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.
June 2, 2025

Hi @Todd Winton 

Short answer: I do not believe an automation rule could generically sort the pages in a space.

 

While there is a REST API endpoint to Move a page to a new location relative to a target page...

https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---children-and-descendants/#api-wiki-rest-api-content-pageid-move-position-targetid-put

And with a CQL expression / search, one could find the sorted list with an ORDER BY title of the pages in the space...

The challenge would be iterating over them to update, one by one, sequentially.

 

Perhaps check if there is a marketplace app to help with this, or investigate building something outside of Confluence that could call the REST API endpoint for the pages, one by one.

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events