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>Display page edit and view restrictions in Confluence to get essential permission details, including users, groups, and inherited access.
Show filtered issues and their relations
Find image within page attachments. Handy for reuse files and update them all at once
This macro allows user to retrieve all pages from current space despite limitation of 250 pages per request
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
An overview of all pages within one space which contains the title, the version, and the last updated date
Displays a list of pages in specific space with certain title or label
Display a list of Confluence pages with CSV download feature