As Confluence admin, you are responsible for administrating your Confluence instance and keeping track of users and their activities.

But how do we go about doing that? Using REP's built-in Suppliers as well as a few choice macros we can build a dashboard so that you can easily track the activity of your users.

Using Reporting, we'll build a dynamic table that will display each user in a particular Confluence user group, their last login details, which other groups they belong to, the number of pages they authored, what pages they authored, and what pages they modified.

The end result will look something like this:


Check it out!



Ingredients

Confluence apps

You will need REP installed on your Confluence.

Suppliers

You will also need to use the following Suppliers:


Full source code

The following source code is shared using Confluence Storage Format, the XHTML-based format that Confluence uses to store the content of pages, page templates, blueprints, blog posts and comments.

For more information on how to use this source code on your Confluence, read the following article:


Click here for the full source code...
<ac:structured-macro ac:macro-id="9dc3ddd5-d509-4f3e-b7e7-418e4f38a91e" 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="f719701f-5cab-4026-aa8e-a3c0a1574c6e" ac:name="user-reporter" ac:schema-version="1">
      <ac:parameter ac:name="groups">conf-users</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="26d38923-0ab2-4230-9ffc-94d15dcba98e" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">User Profile</ac:parameter>
      <ac:rich-text-body>
        <ac:structured-macro ac:macro-id="ad65c475-c34e-4ddb-ab73-d5dc68252694" ac:name="report-image" ac:schema-version="1">
          <ac:parameter ac:name="width">100px</ac:parameter>
          <ac:parameter ac:name="verticalalign">middle</ac:parameter>
          <ac:parameter ac:name="height">100px</ac:parameter>
          <ac:parameter ac:name="">user:picture</ac:parameter>
        </ac:structured-macro>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="74bbd9ea-5a3a-4539-ad04-6ef86793e728" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">User Name</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="81bce228-7b66-44f8-9936-3750757f9890" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:name</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="d6f4a113-725a-4fd6-a576-a9e26ec7d719" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Last Login</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="de67923f-efef-4b72-980a-5892320b61d0" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:last login date</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="811ae9be-8d0c-4ef5-8965-1f358e7fa9a4" 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="bd05a5c8-89ea-42ac-8234-fc1e1c3875eb" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:groups</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="9c56e3af-5820-4248-bf79-cd07e2eff7fe" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title"># of Pages Authored</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="64bee0ff-3c05-4fed-9a5a-040bc97b13f9" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">user:authored pages count</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="3161b475-58dc-4576-a2ef-a549ebb0c537" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Pages Authored</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="0f192e22-1cfa-45aa-8abf-0f0655f8bd07" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="link">true</ac:parameter>
            <ac:parameter ac:name="">user:authored pages</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="bcb17c02-8c41-41bf-b040-d5536d96df8e" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Pages Modified</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="cc97d292-5852-4c10-a99a-756d8668514b" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="link">true</ac:parameter>
            <ac:parameter ac:name="">user:recently modified content</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
CODE

Building this use case

Setting up the report columns

We start by setting up the report columns.

  1. First, create a Report Table macro. This will be the main structure of our report, which is a table.

  2. Next, define what to report using a User Reporter macro. Nest this block inside the Report Table macro.

  3. Edit the User Reporter macro, and type "confluence-users" in User Groups parameter. This means Reporting will only fetch users from the "confluence-users" group. You can specify a different group name based on existing groups you have in your Confluence instance.

User Profile

This will add the user profile picture into the dashboard. 

  1. Within the Report Table macro, insert a Report Column macro underneath the User Reporter macro. Name this column "User Profile".

  2. Insert a Report Image macro inside this Report Column macro.

  3. Edit the Report Image macro, name the Key parameter "user:picture".
    Set verticalalign parameter to "middle", Height and Width parameters to "100px".

User Name

This will allow Reporting to fetch the user's profile and provide a link to their personal space.

  1. Insert a Report Column macro, name this column "User name"

  2. Insert a Report Info macro inside this Report Column macro.

  3. Edit the Report Info macro, name the Key parameter "user:name to" and check the Link To parameter.

Last Login

This column returns the user's last login date.

  1. Insert a Report Column macro and name this column "Last login date".

  2. Insert a Report Info macro inside this Report Column macro.

  3. Edit the Report Info macro and name the Key parameter "user:last login date".

Groups

This column returns the groups in which the user belongs.

  1. Insert a Report Column macro, name this column "Group".

  2. Insert a Report Info macro inside this Report Column macro.

  3. Edit the Report Info macro, name the Key parameter "user:groups".

# of Pages Authored

This column returns the number of pages created by the user.

  1. Insert a Report Column macro and name this column "# of Pages Authored".

  2. Insert a Report Info macro inside this Report Column macro.

  3. Edit the Report Info macro, name the Key parameter "user:authored pages count".

Pages Authored

This column returns the pages which was created by the user.

  1. Insert a Report Column macro, name this column "Pages Authored".

  2. Insert a Report Info macro inside this Report Column macro.

  3. Edit the Report Info macro, name the Key parameter "user:authored pages count".

Pages Modified

This column returns the pages which was recently modified by the user.

  1. Finally, insert a Report Info macro inside this Report Column macro.

  2. Edit the Report Info macro, name the Key parameter "user:recently modified content".

Macro structure

Tips