How do I order Confluence pages via the Java API

Tom Hudgins December 9, 2020

Hi,

I'm using Scriptrunner for Confluence to generate a hierarchy of pages based on this script: https://scriptrunner.adaptavist.com/latest/confluence/rest-endpoints.html?_ga=2.33295928.766920601.1607532354-1624645482.1587410427#_create_project_pages

This works great except that the pages that are generated are ordered alphabetically and not in the order they are in the spec structure (which lists pages to create). I know I can manually reorder pages in the UI but I'm looking for a way to enforce (or correct) the ordering to match the order in my page list (the order I'm creating them in).

Thanks for any guidance.

1 answer

1 accepted

0 votes
Answer accepted
Tom Hudgins December 9, 2020

Never mind, I found it. Just need to call setPosition() on the page after I create it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events