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.
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
$textToHideRecommended Macros
Content that is shown only if a user is in a particular group
Compare unique and common groups between two users
Show confetti bursts and a motivational message upon saving an edited page
The content of this macro will not go to the printing page
Fetch a random quote from the DummyJSON API and display it in a stylized blockquote format.
Display and interact with an OpenAPI / Swagger specification directly in Confluence by rendering a fully featured Swagger UI from a provided JSON URL
Shows worklogs from the Jira issue
Space Information macro by space Id