The macro generates a list of content created by a specified user (or the current user by default) across your Confluence site. The macro uses CQL (Confluence Query Language) to query the content based on creator and content type, and displays the results in a styled list.
#set($user = $parameters.user)
#set($contentTypeParam = $parameters.contentType)
#set($limit = 50) ## Limit the results to 50 items
## Prepare content types for CQL query, defaulting to "page, blogpost, attachment" if none are specified
#if($contentTypeParam)
#set($contentTypes = $contentTypeParam.split(","))
#else
#set($contentTypes = ["page", "blogpost", "attachment"])
#end
#set($contentTypeQuery = $StringUtils.join($contentTypes, "', '"))
## CQL query setup based on user parameter
#if($user)
#set($cqlQuery = "creator = '$user' AND type IN ('$contentTypeQuery') ORDER BY created DESC")
#else
#set($cqlQuery = "creator = currentUser() AND type IN ('$contentTypeQuery') ORDER BY created DESC")
#end
## Execute the CQL query, expanding space and version data
#set($response = $ConfluenceManager.get("/wiki/rest/api/content/search?cql=$cqlQuery&limit=$limit&expand=space,version"))
## Initialize userName to display in the header
#set($userName = "Current user")
#if($response.results.size() > 0)
#set($userName = $response.results[0].version.by.displayName)
#end
<ul>
<p style="margin-bottom: 10px;">
Content created by <strong>$userName</strong>:
</p>
#if($response.results.size() > 0)
#foreach($content in $response.results)
<li style="list-style-type: circle; margin-left: 30px;">
<span class="aui-lozenge aui-lozenge-subtle aui-lozenge-success">$content.type</span>
<a href="${response._links.base}$content._links.webui" target="_blank">$content.title</a>
<span style="color: var(--ds-text-subtle, #292a2e);">(in $content.space.name space)</span>
</li>
#end
#else
<li>No content found for <strong>$userName</strong>.</li>
#end
</ul>Show confetti bursts and a motivational message upon saving an edited page
Perform customized searches based on labels, content types, and other parameters
Convert a specified amount of cryptocurrency to a fiat currency
Make sure content is included only in printed or exported versions of a Confluence page
Display a list of guest users in a specific Confluence space
Display the top comments from a selected Confluence page, or from the current page by default
Display Confluence users filtered by their email addresses
Display the number of users who have access to each space
Display a personalized greeting message for a logged-in user
Add a configurable sticky banner to a Confluence page