Stand with Ukraine 🇺🇦

Creator — Confluence Cloud Macro

confluence-content

This macro displays a mention of the user who created the current Confluence page. If the current user is the page's creator, the mention is styled in blue; otherwise, it is styled in gray. The macro uses the $StringUtils.equals() method to check the user ID.

Try for free

User Parameters

This macro comes without configurable user parameters.

Template

## Check if current user is the author
#set ($isCurrentUser = $StringUtils.equals( $user.accountId, $page.authorId ))

#if ( $isCurrentUser )
  ## Only current user styled with blue
  #set( $blueStyle = "aui-lozenge-inprogress" )
#else
  ## Retrieve author details and rewrite user variable
  #set ($user = $ConfluenceManager.get("/wiki/rest/api/user?accountId=$page.authorId" ))
#end

## Return the Mention
<a href="${baseUrl}/people/${user.accountId}">
  <span class="aui-lozenge $blueStyle">
    @$user.displayName
  </span>
</a>