This macro generates an overview of all pages in a Confluence space, displaying the title, version, and last updated date. It uses the Confluence API to fetch the pages and formats them in a sortable AUI table.
## get pages in the current space
#set($spaceId = $space.id )
#set($sort = "-modified-date") ## order by modified date DESC
#set($status = "current") ## skip archived, deleted, and drafted
#set($limit = 250) ## increase pages limit to maximum
#set($url = "/wiki/api/v2/spaces/${spaceId}/pages?sort=${sort}&status=${status}&limit=${limit}")
#set($response = $ConfluenceManager.get($url))
## Use of Atlassian UI (AUI) sortable table
<table class="aui aui-table-sortable">
<thead>
<tr>
<th>Title</th>
<th>Version</th>
<th>Last updated</th>
</tr>
</thead>
<tbody>
## iterate through results of pages
#foreach($page in $response.results)
<tr>
<td>${page.title}</td>
## "aui-badge" will put number in a grey circle
<td><span class="aui-badge">${page.version.number}</span></td>
## Convert datetime to date
## "2024-02-13T12:12:31.528Z" -> "2024-02-13"
#set($createdAt = $StringUtils.substringBefore($page.version.createdAt, "T"))
<td>${createdAt}</td>
</tr>
#end
</tbody>
</table>Display space details such as type, status, creation date, and links to permissions and calendars
Display Confluence page edit and view restrictions to provide essential permission details, including users, groups, and inherited access
Show an expandable page tree for a selected parent page, defaulting to the current page
Read and display the fixed version of Confluence pages by checking page or ancestor labels
Retrieve and display all page content properties in an AUI sortable table
List all Confluence spaces with details such as space name, author, and creation date
Allow users to retrieve all pages from the current space despite the 250-page limit per request
Based on CQL, show a table with the following columns: Page Title, Author, Updated, and Status
Generate an alphabetical list of labels from all spaces, linking each label to its corresponding content pages
Display a custom list of recently updated content