How to sort getChildren() by created date in user macro

tanaji710
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 8, 2020

Hi i have created one user macro in which i have used $pageManager.getPage($topic.id).getChildren() in this i am getting list of pages sorded by modified date but i want to sort that childrens by created date how i can do that let me know 

Thanks In Advance!!!

1 answer

0 votes
Bill Bailey
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.
September 8, 2020

You are going to have to bubble sort your array before output. I will point you to a user macro that gives and example of sorting child pages.

/confluence-include-child-pages-macro 

Tanajee October 28, 2020

Thanks @Bill Bailey i had implemented solution provided by you but still for some spaces it's not providing list sequence same as page tree can you help me to solve this ?

Bill Bailey
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.
October 29, 2020

What order is it presenting the pages? Alphabetically or creating date? Is the page tree manually sorted?

Tanajee October 29, 2020

Page Tree is sorted according to Created Date 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events