Moving pages through API - update page tree, re-position the page?

Marcin Adamski
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 2, 2019

Hi,

I have a question regarding moving pages using the REST API. I've been able to do it using the update-content method, but it seems like it's not exactly perfect.

confluence.png

As you can see on the picture, the page says it's moved, but visually it stays in the same place it was originally created. Do you have any ideas as to how to overcome this? I've seen the pages update and show up in the correct place at some times, but I'm not sure whether it's a matter of time, or just updating the page tree in a different way (ie. adding new page, as this seems to update it) and would like to make it happen instantly, or at least to be able to force it through the API as well (couldn't find anything in the documentation, although it's not the best to be honest...).

 

Also additional question - is there a way to change how pages are sorted under a specific parent? Or are pages always added at the end? Because in some cases we would need the page to be on the top. If it's not configurable then how to move it via API? Because currently the page is created via third party, and the most I could do is move it, but I can't really comprehend how, there is the:
"extensions": {
      "position": "none"
}

node which I thought would do it, but I can't get it to work.

 

To be clear - I will be calling the API via PowerShell, have some scripts prepared already and hope I'll be able to finish what's required :)

 

2 answers

1 accepted

0 votes
Answer accepted
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2019

Hey there, Marcin!
I may not be the perfect match for your request, however, I have found this thread in our Community. A pretty recent thread, for that matter:

Maybe you can compare your API calls with the ones presented in the thread and check if there is anything worth improving.

To address your second question. Yes, we can reorder pages in Confluence Cloud. There is also a thread about our recent change applied to page order. You can have a peek here, Marcin:

However, there is no method to reorder pages via the REST API. You can check a reported Feature Request about it here:

Hope this helps you out, Marcin! Looking forward to your reply.

Marcin Adamski
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 3, 2019

Hi Diego,

Thanks for the response, I saw the first question originally, but thought this could be resolved in a different way and I wouldn't have to use a workaround, but I guess this will be fine for now.

As for the order of the pages however - is this change of yours already taken back? Because every page created on our confluence ends up at the bottom, and I don't see an option to change it, I only can make it alphabetical where it was modified manually, it would be great if there were options to set for example - create all pages under this parent at the top, but do it alphabetically otherwise, because it's not always needed to be the same way.

I hope there will come an option to change it via REST API, or configuration that will handle it, so we wouldn't need to do it manually.

 

I'll accept your answer since it seems the workaround is the only way currently, and there's no way to re-order via API currently so not expecting anyone to answer differently :D

Supreet
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2019

@Marcin Adamski This has been due to new drag and drop and I have already reported below bug for the same: https://jira.atlassian.com/browse/CONFCLOUD-67046

0 votes
Craig Anderson January 6, 2023

There is an API call which should do everything you want: Move position 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events