Stand with Ukraine 🇺🇦

ShowIf — Confluence Cloud Macro

confluence-content

This macro checks if the current user belongs to a specified group, and if so, displays a block of content. It uses a foreach loop to iterate through the user's groups and compares them with the target group using $StringUtils.equals().

Try for free

User Parameters

This macro comes without configurable user parameters.

Template

## Show content if user is in the following group
#set($adminGroup = "site-admins") ## Your group name in this line 

#foreach ( $item in $user.groups )
  #if ( $StringUtils.equals($item.name,$adminGroup) )
  
    ## Text below will be printed
    <b>Text that will be shown only to site admins</b>
  #end
#end