When you have a page with a lengthy discussion or you want to keep track of the activity, you might want to get an overview of the discussion at a glance.
This report compiles and display comments, commentators and replied comments of a page inside a table.
You can copy and paste this code into the Confluence Source Editor:
You can recreate the example in the editor view:
- Create a report-table macro to host the report inside a table.
- Add a Local Reporter macro inside the report-table macro, because we are interested to report on a single page only. To get all comments on the page, make sure key is set to "page:all comments".
- Now, create as many report-column macros with report-info macros as you wish. These would host all the details of each comment. To retrieve details of the comments, we can make use of the keys available through Comment Supplier.
In this example, we create these columns with corresponding key for report-info macros:
- The user who commented, with key "comment:creator"
- The comment summary, with key "comment:summary"
- The user(s) who replied to the comment, with key "comment:repliers"
- The comment summary, with key "comment:children > collect body > collect text ". This retrieves the replies and displays the comment replies.
(Bonus) To calculate the time lapsed since the comment was made, create another report-column macro called "Days ago". Enable injection, because we are going to use an advanced notation. Create a report-eval macro and set format to "#" so the number of days will be rounded. To calculate, use this notation for the report-eval macro:
(%global:current date>date:milliseconds% - %comment:creation date>date:milliseconds%)/