Stand with Ukraine 🇺🇦

Page Pagination — Confluence Cloud Macro

confluence-contentformatting

Loops through API requests to collect all pages in a space and lists their titles.

Try for free

User Parameters

This macro comes without configurable user parameters.

Template

#set($allPagesInSpace=[])
#set($link="/wiki/api/v2/spaces/$space.id/pages?limit=250")

#foreach($n in [1..1000]) ## Range can be set to bigger number if needed
  #set($pages=$ConfluenceManager.get($link))
  #set($noPrint=$allPagesInSpace.addAll($pages.results))
  
  #if($pages._links.next)
    #set($link=$pages._links.next)
  #else
    #break
  #end
#end

#foreach ( $page in $allPagesInSpace )
  <li>$page.title</li>
#end