This Confluence user macro displays a page’s fixed version by scanning for labels starting with fixed-version_. It uses the Confluence Cloud REST API to check the labels of the current page and its parent pages (up to the space homepage), allowing version values to be set once and reused across related documents. This makes it easy to keep release information consistent across multiple pages.
#set($fixVersion = "")
#set($pageIdToCheck = $page.id)
#foreach ($i in [1..50]) ## Set a safety limit to prevent infinite loops
#if ($pageIdToCheck)
#set($labelResponse = $ConfluenceManager.get("/wiki/api/v2/pages/$pageIdToCheck/labels"))
#if ($labelResponse && $labelResponse.results)
#foreach ($label in $labelResponse.results)
## Look for label starting with e.g. "fixed-version_450"
#if ($label.prefix == "global" && $label.name.startsWith("fixed-version_"))
## $fixVersion = 450
#set($fixVersion = $label.name.substring(14))
#break
#end
#end
#end
#if ($fixVersion != "")
#break
#end
#if ($pageIdToCheck == $space.homepageId)
#stop
#end
#set($pageInfo = $ConfluenceManager.get("/wiki/api/v2/pages/$pageIdToCheck"))
#if ($pageInfo && $pageInfo.parentId)
#set($pageIdToCheck = $pageInfo.parentId)
#else
#break
#end
#end
#end
#if ($fixVersion != "")
$fixVersion
#else
<span>
No fixed version found. Label this page or one of its parents with
<code>fixed-version_x.y.z</code>.
</span>
#end
Display Confluence page edit and view restrictions to provide essential permission details, including users, groups, and inherited access
Retrieve and display all page content properties in an AUI sortable table
Display an overview of all pages in a space, including title, version, and last updated date
Allow users to retrieve all pages from the current space despite the 250-page limit per request
Display issues using a custom JQL filter
Display space details such as type, status, creation date, and links to permissions and calendars
Show an expandable page tree for a selected parent page, defaulting to the current page
Insert a page break in documents generated from a Confluence page
Find images within page attachments. Handy for reusing files and updating them all at once.
Generate IDs in Base32 format