This Confluence user macro fetches and displays a table of page attributes based on a CQL query, including page title, author, last updated date, and status. It uses REST API calls to retrieve metadata and applies color-coded status indicators for better visibility.
#set( $url = "/wiki/rest/api/content/search?cql=type=page and $parameters.query&limit=100&expand=version,history,space")
#set( $pages = $ConfluenceManager.get($url).results )
## Color mapping between statuses and Storage format
#set( $colors = {
"#ffc400": "Yellow",
"#2684ff": "Blue",
"#57d9a3": "Green",
"#8777d9": "Purple",
"#ff7452": "Red"} )
<table>
<thead>
<tr>
<th>Page</th>
<th>Author</th>
<th>Updated</th>
<th>Status</th>
</tr>
</thead>
<tbody
#foreach ( $p in $pages )
## Get status of the page. Name and color
#set($state = $ConfluenceManager.get("/wiki/rest/api/content/$p.id/state").contentState)
#if($state)
#if($state.name == "Verified")
#set($sName = "✅ Verified")
#set($sColor = "")
#else
#set($sName = $state.name)
#set($sColor = $colors.get($state.color))
#end
#end
<tr>
## page
<td>
<ac:link>
<ri:page ri:space-key="${p.space.key}" ri:content-title="${p.title}"/>
<.ac:link>
</td>
## author
<td>
<ac:link>
<ri:user ri:userkey="${p.history.createdBy.accountId}"/>
</ac:link>
</td>
## updated date
<td>$p.version.friendlyWhen</td>
## status
<td>
#if($state)
<ac:structured-macro ac:name="status">
<ac:parameter ac:name="title">$sName</ac:parameter>
<ac:parameter ac:name="colour">$sColor</ac:parameter>
</ac:structured-macro>
#end
</td>
</tr>
#end
</tbody>
</table>Show filtered issues and their relations
Find images within page attachments. Handy for reusing files and updating them all at once.
Allow users to retrieve all pages from the current space despite the 250-page limit per request
Display Confluence page edit and view restrictions to provide essential permission details, including users, groups, and inherited access
Display and interact with an OpenAPI/Swagger specification directly in Confluence by rendering a fully featured Swagger UI from a provided JSON URL
Retrieve and display current exchange rates for major currencies against a specified base currency
Display a custom list of recently updated content
Retrieve and display all page content properties in an AUI sortable table
Display an overview of all pages in a space, including title, version, and last updated date
Displays a list of pages in a specific space with a specified title or label