The macro retrieves all Confluence groups and iterates through them to gather members. It checks each member's email against a specified filter, storing matching email addresses and corresponding display names in a map. If matches are found, it presents the results in a table format.
## Fetch groups
#set($groups = $ConfluenceManager.get("/wiki/rest/api/group"))
## Check if there are any groups available
#if ($groups && $groups.results.size() > 0)
#set($uniqueEmails = {}) ## A map to store unique email addresses and corresponding user names
## Loop through each group to retrieve group members
#foreach($group in $groups.results)
#set($groupMembers = $ConfluenceManager.get("/wiki/rest/api/group/$group.id/membersByGroupId"))
## Loop through each member in the group
#foreach($member in $groupMembers.results)
## Check if the email matches the filter and is not already in the uniqueEmails map
#if ($StringUtils.contains($member.email, $parameters.emailFilter) && !$uniqueEmails.containsKey($member.email))
#set($discard = $uniqueEmails.put($member.email, $member))
#end
#end
#end
## If no matches are found, show a message indicating no matching email addresses
#if ($uniqueEmails.size() == 0)
<p>
No email addresses match the filter: <strong>$parameters.emailFilter</strong>
</p>
#break
#end
## If there are matching email addresses, display them in a table
#if ($uniqueEmails.size() > 0)
<table class="aui aui-table-interactive aui-table-rowhover" style="width: fit-content;">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
## Loop through the uniqueEmails map to display each entry
#foreach($entry in $uniqueEmails.entrySet())
<tr>
<td><a href="${baseUrl}/people/${entry.value.accountId}" target="_blank">$entry.value.displayName</a></td>
<td><a href="mailto:$entry.key">$entry.key</a></td>
</tr>
#end
</tbody>
</table>
#end
#endUser macro for displaying issues using custom JQL filter
Display a list of guest users in a specific Confluence space
List out a table to display the assignee history for Issues by JQL. Shows the following information: Issue Key, Summary, and Assignee history
Displays a list of pages in specific space with certain title or label
Display a list of Confluence pages with CSV download feature
Display information about how many users have access to each space
Display the top comments from a selected Confluence page or the current page by default.
Show filtered issues and their relations
Macro that dynamically lists all its child pages in a table format
List issues (work items) from Jira to get essential information in a readable and well-organized format