Stand with Ukraine 🇺🇦

HideIf — Confluence Cloud Macro

confluence-contentformatting

This macro hides content from users who are part of a specific group. It checks the user's groups and, if a match is found, sets the content to be hidden by setting the $textToHide variable to an empty string.

Try for free

User Parameters

This macro comes without configurable user parameters.

Template

## Hide content if user is in the following group

## your group name in the $hideIfGroup variable
#set ($hideIfGroup="jira-admins-wombats-test") 

## hidden text stored in the $textToHide variable
#set ($textToHide="<b>Text which is hidden from 'contractors'</b>")

## A bit of logic
#foreach ( $group in $user.groups ) ## go through each user's group
  #if ( $StringUtils.equals($group.name, $hideIfGroup) ) ## compare with target
    #set ($textToHide="") ## Set empty if user is in group
  #end
#end

$textToHide