This user macro displays an image from Confluence attachments using a filename reference. It supports optional height and width settings and validates allowed formats (PNG, JPG, GIF). If the file exists, it renders the image via <ac:image> with its latest download link, keeping visuals updated. It shows warnings if the file is missing or invalid. Ideal for shared assets like logos or UI screenshots—update once, reflect everywhere automatically.
## Check for incompitable filetype
#set ( $name = $parameters["searchName"] )
#if(!$StringUtils.endsWithAny($name.toLowerCase(), ".png", ".jpg", "jpeg", ".gif" ))
<div style="padding: 10px; border-radius: 3px;">
<div style="display: inline-block; width: 95%;">
<div style="margin: 1px 0 5px 0;">
<ac:emoticon ac:name="warning" ac:width="30px" /> Image [$name] must be PNG, JPG, or GIF format. Update the Attachment parameter
</div>
</div>
</div>
#stop
#end
## Make the search
#set ( $results = $ConfluenceManager.get("/wiki/api/v2/attachments?limit=1&sort=-modified-date&status=current&filename=$name").results)
## Show a warning if nothing found
#if(!$results)
<div style="background-color: #fef7c8; padding: 10px; border-radius: 3px;">
<div style="display: inline-block; width: 95%;">
<div style="margin: 1px 0 5px 0;">
<ac:emoticon ac:name="warning" ac:width="30px" /> No [$name] attachments has been found (Hint: <i>search is case-sensitive</i>)
</div>
</div>
</div>
#stop
#end
## Add an image in Storage Format
## Note that not all Atlaskit design tokens (example: var(--ds-text, #ffffff)) work in static macros. Check that case by case
#set ( $url = "${baseUrl}$results[0].downloadLink" )
<ac:image
ac:alt="$name"
ac:title="$name"
ac:height="$parameters['height']"
ac:width="$parameters['width']">
<ri:url ri:value="$url"/>
</ac:image>Show all attachments from the current space in a sortable table view
Display Confluence page edit and view restrictions to provide essential permission details, including users, groups, and inherited access
Display the top comments from a selected Confluence page, or from the current page by default
Retrieve and display all page content properties in an AUI sortable table
Display Jira issue comments in a table
Perform text searches within pages, blog posts, and attachments
Allow users to retrieve all pages from the current space despite the 250-page limit per request
Display an overview of all pages in a space, including title, version, and last updated date
Show an expandable page tree for a selected parent page, defaulting to the current page
Read and display the fixed version of Confluence pages by checking page or ancestor labels