Filter users by email domain

Filter users by email domain

Scenario

Combining the Text Filter and User Reporter macros lets you filter and list certain users from the confluence-users group. 

Given the following Confluence users:

Result

Recipe

Apps

Reporting for Confluence Data Center

Level

Easy

Estimated time

10 minutes

Macros

Report Column, Report Info, Report Table, Text Filter, User Filter

Suppliers

Report Supplier, Text Supplier, User Supplier

Storage format

You can copy and paste this code into the Confluence Source Editor:

<ac:structured-macro ac:macro-id="60583f9e-30c0-4a45-8bb6-3392e00ad85e" ac:name="report-table" ac:schema-version="1"><ac:parameter ac:name="injected">true</ac:parameter><ac:rich-text-body><ac:structured-macro ac:macro-id="69abf7f4-375c-441b-992e-61ef27ab3cb0" ac:name="user-reporter" ac:schema-version="1"><ac:parameter ac:name="groups">confluence-users</ac:parameter><ac:rich-text-body> <p>&#xa0;<ac:structured-macro ac:macro-id="8b906441-d031-41dc-b35d-8f0b25eb41b8" ac:name="text-filter" ac:schema-version="1"><ac:parameter ac:name="include">.*gmail.*</ac:parameter><ac:parameter ac:name="">user:email</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:macro-id="4b7968ae-8f05-463f-b8f1-1a95d8d17db8" ac:name="report-column" ac:schema-version="1"><ac:parameter ac:name="injected">true</ac:parameter><ac:parameter ac:name="title">Confluence Users Who use Gmail</ac:parameter><ac:rich-text-body> <p><ac:structured-macro ac:macro-id="269b77e4-9e28-4e8e-a65e-ae8a31bcc5c7" ac:name="report-info" ac:schema-version="1"><ac:parameter ac:name="">user:email</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>

Macro structure

You can recreate the example in the editor view:

Steps

  1. Create a Report Table macro with Injected: selected.

  2. Within the Report Table, create a User Reporter macro with Groups: confluence-users.

  3. Within the User Reporter macro, create a Text Filter macro with the following parameters:

    • Key: user:email

    • Include: .*gmail.*

  4. Within the Report Table macro, under the User Reporter macro, create a Report Column macro with the following parameters:

    • TitleConfluence Users Who use Gmail

    • Injected: selected

  5. Within the Report Column macro, create a Report Info macro with Keyuser:email.