Filter page results based on user

Scenario

This recipe shows you how to filter the page results based on the user. 

As the example in the result, we are filtering the page that have created by 'Kevin Lew' and display the page information in a table. 


Result


Recipe

Ingredients

Storage format

Macro structure

You can recreate the example in the editor view:

Steps

  1. Add a 2 x 1 table.

  2. Set first column as Header and write "Choose User to filter".

  3. In second column, create a List Data macro and set the following parameters:
    Field Name: myUser
    Type: auto complete
    Required: uncheck
    Allow Multiple: uncheck

  4. Within List Data macro, create User Options macro.
    Set Groups to "confluence-users".

  5. Under the table, create Report On macro and set the following parameters:

    Key: data:myUser>join with " ">text:find .*?'.*?'.*?

    Injected: checked

  6. Within Report On macro, create Report Variable macro and set the following parameters:
    Name: "X"
    Value%match:value>match "(.*?)\\u0027(.*?)\\u0027(.*?)">group 2%

  7. Under Report On macro, create Report Table and tick Injected parameter.

  8. Within Report Table macro, create Content Reporter macro and types set it to "pages".

  9. Within Content Reporter macro, create Text Filter macro and set the following parameters:
    Keypage:creator>user:name
    Exact Value%variable:X%

  10. Within Content Reporter macro and under Text Filter macro, create Text Sort macro and set the following parameters:
    Key: page:creator>user:name
    Order: ascending

  11. Under Content Reporter macro, create four Report Column macros.

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

  13. Set the second Report Column macro's Title to "Creation Date".
    Set the Report Info macro's Key to "page:creation date".

  14. Set the third Report Column macro's Title to "Modification Date".
    Set the Report Info macro's Key to "page:modification date".

  15. Set the forth Report Column macro's Title to "Page Creator".
    Set the Report Info macro's Key to "page:creator>user:full name".
    Tick Link To Item.