This Confluence user macro uses the Confluence Cloud REST API with CQL search to retrieve recently updated pages, blog posts, and attachments using user-defined limits, type inclusion, and prefix-based exclusion. It expands last-updated metadata, normalizes timestamps for display, and renders results as a square-bulleted list with type-based emoji, title links, and a muted author/date line.
The macro includes an early-return empty state and overflow-safe styling so the content always fits naturally within its container.
## Add styling
<style>
.recent-list {
list-style-type: square;
padding-left: 20px;
margin: 0;
}
.recent-list li {
max-width: 100%;
}
.recent-item {
display: flex;
flex-direction: column;
min-width: 0;
}
.recent-title {
display: inline-flex;
align-items: center;
gap: 6px;
min-width: 0;
}
.recent-title a {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
.recent-emoji {
font-size: 16px;
flex-shrink: 0;
}
.recent-meta {
font-size: 12px;
margin-left: 22px;
max-width: 100%;
}
.empty-state {
margin: 0;
padding: 12px;
background-color: var(--ds-background-information, #e9f2fe);
}
</style>
## Normalize date format
#set ($format = "yyyy-MM-dd'T'HH:mm:ss.SSSX")
## Read user params
#set ($limit = $parameters["limit"])
#if (!$limit)
#set ($limit = 20)
#end
#set ($includeBlog = $parameters["includeBlogpost"])
#set ($includeAttach = $parameters["includeAttachment"])
#set ($exclude = $parameters["exclude"])
## Build CQL query
#set ($types = [])
#set ($void = $types.add("page"))
#if ($includeBlog == true || $includeBlog == "true")
#set ($void = $types.add("blogpost"))
#end
#if ($includeAttach == true || $includeAttach == "true")
#set ($void = $types.add("attachment"))
#end
#set ($typeCql = $types.toString().replace("[","").replace("]",""))
#set ($cql = "type in (${typeCql})")
#if ($exclude && $exclude != "")
#set ($cql = "${cql} AND NOT title ~ '${exclude}*'")
#end
#set ($cql = "${cql} ORDER BY lastmodified DESC")
## Fetch content
#set ($url = "/wiki/rest/api/content/search?expand=history.lastUpdated,version&limit=${limit}&cql=${cql}")
#set ($result = $ConfluenceManager.get($url))
## Set empty state message
#if (!$result.results || $result.results.size() == 0)
<p class="empty-state">
We looked everywhere, but it seems there are no issues for now 😔
</p>
#else
## Render results
<ul class="recent-list">
#foreach ($item in $result.results)
#set ($type = $item.type)
#if ($type == "page")
#set ($emoji = "📄")
#elseif ($type == "blogpost")
#set ($emoji = "📰")
#elseif ($type == "attachment")
#set ($emoji = "📎")
#else
#set ($emoji = "📁")
#end
## Read meta data
#set ($author = $item.history.lastUpdated.by.displayName)
#set ($whenRaw = $item.history.lastUpdated.when)
<li>
<span class="recent-item">
<span class="recent-title">
<span class="recent-emoji">$emoji</span>
<a href="$baseUrl$item._links.webui">$item.title</a>
</span>
<span class="recent-meta">
Contributed by $author on $DateUtils.parseDate($whenRaw, $format)
</span>
</span>
</li>
#end
</ul>
#endGet the latest cryptocurrency exchange rates for major coins
Display an overview of all pages in a space, including title, version, and last updated date
Retrieve and display all page content properties in an AUI sortable table
Display the creation date of the current Confluence page
Display Confluence page edit and view restrictions to provide essential permission details, including users, groups, and inherited access
Generate a list of all content created by the current user by default, or by a specified user, across your Confluence site
Perform customized searches based on labels, content types, and other parameters
Based on CQL, show a table with the following columns: Page Title, Author, Updated, and Status
Find images within page attachments. Handy for reusing files and updating them all at once.
Display a list of guest users in a specific Confluence space