How to place a new page at the top of the parent page when automating page creation?

zhaoxiang_daqiao_
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!
December 14, 2023

Hello Community

When I create a new page using automation, by default the new page is placed at the very bottom of that parent page.

But I personally like to put new pages at the top of the drop-down list so I can quickly find the latest documents.

Please tell me how I can set it up in automation to achieve my needs. Thanks!

1 answer

0 votes
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 14, 2023

Hey @zhaoxiang_daqiao_ 

Currently, there isn't any way through the Automation. 

I checked the API and it's a bit tricky!

Find the approach below

First, get the descendant of the parent page using the below API

You must know the parent page ID when you call an API via automation

https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---children-and-descendants/#api-wiki-rest-api-content-id-descendant-get

curl --request GET \ 
--url
'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/descendant' \
--user
'email@example.com:<api_token>' \
--header
'Accept: application/json'

Once you get the first descendant, store the ID of the descendant page ID

Then call the API to reorder the newly created page at the top (here you must know the Page ID of the newly created page via automation

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

curl --request PUT \ 
--url
'https://your-domain.atlassian.net/wiki/rest/api/content/{pageId}/move/before/{targetId}' \
--user
'email@example.com:<api_token>' \
--header
'Accept: application/json'

Thanks,
Pramodh

zhaoxiang_daqiao_
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!
December 19, 2023

Hi Pramodh
Thanks for the reply. This is a bit beyond my capabilities. I’d better wait for the official to improve the relevant automation functions. Anyway, thank you very much!😄

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events