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?
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.