Stand with Ukraine 🇺🇦

Aggregated Page Attributes in One Table

Aggregated pages attributes - Based on CQL, show a table with the following columns: Page Title, Author, Updated, and Status - Preview 2
Aggregated pages attributes - Based on CQL, show a table with the following columns: Page Title, Author, Updated, and Status - Preview 3
confluence-content

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.

Try for free

Template

#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>

User Parameters

Search Query

CQL query, for instance: space = IDEAS or label = idea

Chosen by Top Global Companies Across Diverse Industries

BNP Paribas
Census
CNES
EDP
HHMI
HP
Hyundai
Index
Intercars
Melia
BNP Paribas
Census
CNES
EDP
HHMI
HP
Hyundai
Index
Intercars
Melia
Ministry
NVIDIA
PayPay
Pfizer
Qualcomm
Rail Canada
Red Cross
SEC
Space Institute
Telefonica
Ministry
NVIDIA
PayPay
Pfizer
Qualcomm
Rail Canada
Red Cross
SEC
Space Institute
Telefonica

Got Questions?

Fill out the form, and we'll guide you through every step of the way