You can create an overview report of comment activities in your space, to see where discussions are happening and to keep track of comments that require attention.
This recipe creates a report that compiles and displays all comments from a space in a form of a table on a page. It includes inline comments and the statuses - Resolved, Open, Dangling, as well as inline comment replies.
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 Content Reporter macro inside the report-table macro. To list only comments, make sure type is set to "comment". Optionally, add a Text Sort macro to automatically sort your report items e.g. by page name, created date or inline comment status. In this example, we use "comment:creation date" as the key for the text-sort macro.
- 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 comment text, with key "comment:body". Make sure the macro Render parameter is set to "richtext" so it renders HTML well.
- Type of comments, with key "comment:comment type"
- The highlighted comment (if it's an inline comment), with key "comment:inline-selection"
- The inline comment status (if it's an inline comment), with key "comment:inline-status"
- The user who commented, with key "comment:creator"
(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: