HideIf — Confluence Cloud Macro
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.
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
$textToHideYou May Also Like
Content that is shown only if a user is in a particular group
Compare unique and common groups between two users
Macro for generating ID in base32 format
Show confetti bursts and a motivational message upon saving an edited page
Add a configurable tile to a Confluence page
Read and display the fixed version of Confluence pages by checking page or ancestor labels
Find image within page attachments. Handy for reuse files and update them all at once
Basic greeting for user
User macro for displaying issues using custom JQL filter
Create dropdown menus in Confluence Cloud with predefined sets of options, multiselect features, and permission gates