Add a dropdown filter to the Space Inline Comment Report

Scenario

This recipe allows you to create an inline comment report for a specific Confluence space. 

To make this report dynamic and allow users to select which space to report on, we are using Scaffolding's List Data macro. The List Data macro will appear as a dropdown menu with all available spaces for users to select from. Once the user has selected the space, the inline comment report for that particular space will be executed.

Without the Scaffolding List Data macro used in this example, users will need to edit the page and change the Spaces value in Content Reporter macro to select which Space to report on.


Result


Recipe

Ingredients

Apps

Reporting, Scaffolding
Platform
Server
Level

INTERMEDIATE

Estimated time

30 minutes

Macros

Suppliers

Storage format

Macro structure

You can recreate the example in the editor view:

Steps

  1. Create a List Data macro for the user to select the Space they want to report on.
    To achieve this follow the steps below:

    1. Create a Report Block macro. Set Injected parameter to True.
    2. Within the Report Block macro, create a Space Reporter macro to report on all the Spaces in Confluence.
    3. Create a Report Body macro.
    4. Within the Report Body macro, create a List Option macro to feed the spaces into a dropdown menu.
      Set the parameters as below:
      Value: %space:key%
      Label: %space:name%

  2. Create a Report Table macro.
    Set Injected parameter to True.

  3. Within Report Table macro, create a Content Reporter macro and set the following parameters:
    Type: comment
    Spaces %data:spaces>first%

  4. Within Content Reporter macro, create a Text Sort macro.
    Set the Text Sort macro's Key to "comment:creation date".

  5. Within Content Reporter macro, create a Text Filter macro.
    Set the Text Filter macro's Key to "comment:inline-status".
    Set Required parameter to True.

  6. Within Report Table macro, under Content Reporter macro, create 8 Report Column macros.

  7. Set the first Report Column macro's Title to "Space" and add a Report Info macro within it.
    Set the Report Info macro's Key to "comment:space".

  8. Set the second Report Column macro's Title to "Page" and add a Report Info macro within it.
    Set the Report Info macro's Key to "comment:page". 
    Tick Link To Item.

  9. Set the third Report Column macro's Title to "Comment" and add a Report Info macro within it.
    Set the Report Info macro's Key to "comment:body".
    Tick Link To Item.

  10. Set the forth Report Column macro's Title to "Author" and add a Report Info macro within it.
    Set the Report Info macro's Key to "comment:creator".

  11. Set the fifth Report Column macro's Title to "Repliers" and add a Report Info macro within it.
    Set the Report Info macro's Key to "comment:repliers > collection:join with ", "".

  12. Set the sixth Report Column macro's Title to "Status" and add a Report Info macro within it.
    Set the Report Info macro's Key to "comment:inline-status".

  13. Set the seventh Report Column macro's Title to "Reply Count" and add a Report Info macro within it.
    Set the Report Info macro's Key to "comment:reply count".

  14. Set the eighth Report Column macro's Title to "Age" and check Injected parameter to set it to TrueThen add a Report Eval macro within it. 
    Copy the following code inside the Report Eval macro:
    "(%global:current date>date:milliseconds% - %comment:creation date>date:milliseconds%)/1000/60/60/24".

  15. Save the changes.

  16. Now, you can click on Edit Contents to select the Space to report on.