Generating a List of Groups for the Current User

Scenario

By using the Expanding Reporter macro combined with the User Supplier you are able to get reports on what groups the current user is enrolled in. 

This recipe generates a list of groups for the current user and displays it in a single column table.

 

Result

 

 

Recipe

Apps

Reporting for Confluence Server & Data Center

Apps

Reporting for Confluence Server & Data Center

Level

Intermediate

Estimated time

15 minutes

Macros

Expanding Reporter, Report Column, Report Info, Report On, Report Table, User Reporter

Suppliers

Expanded Supplier, Global Supplier, User Supplier

Storage format

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

<p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="c46cb40b-3919-4e16-9822-fe17de83d20c" ac:name="report-on" ac:schema-version="1"> <ac:parameter ac:name="injected">true</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> <ac:rich-text-body> <p> <strong>Groups For:</strong> %global:current user &gt; user:full name%</p> <ac:structured-macro ac:macro-id="483107fd-5a67-4586-b60c-814035aa228e" ac:name="report-table" ac:schema-version="1"> <ac:rich-text-body> <p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="62e1dbe7-9749-434c-9e6b-6bc65d992f62" ac:name="expanding-reporter" ac:schema-version="1"> <ac:parameter ac:name="as">Group</ac:parameter> <ac:parameter ac:name="">user:groups</ac:parameter> <ac:rich-text-body> <p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="2764f6e4-512e-46e8-a5a9-d06930f8c3ff" ac:name="user-reporter" ac:schema-version="1"> <ac:parameter ac:name="user"> <ri:user ri:username="%global:current user > user:name%" /> </ac:parameter> <ac:rich-text-body> <p> <br /> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="41ef71ec-7a45-4d66-bd36-9e78641a4078" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Groups</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="20eb2452-ec10-4f8c-a5a9-450d879f2b58" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">expanded:Group &gt; name</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p>

Macro structure

You can recreate the example in the editor view:

 

Steps

  • N/A

Line-by-Line Explanation

  • N/A