List all comments including unresolved inline comments

List all comments including unresolved inline comments

Scenario

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.

Result

Recipe

Apps

Reporting for Confluence Data Center

Level

Intermediate

Estimated time

10 minutes

Macros

Content Reporter, Report Column, Report Info, Report Table

Suppliers

Comment Supplier

Storage format

You can copy and paste this code into the Confluence Source Editor:

<ac:structured-macro ac:macro-id="d23a274e-44e4-4efc-98cd-032d38b8356b" ac:name="report-table" ac:schema-version="1"> <ac:rich-text-body> <ac:structured-macro ac:macro-id="294e14ca-ab92-4eec-b94f-fd3496295237" ac:name="content-reporter" ac:schema-version="1"> <ac:parameter ac:name="types">comment</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="e9c32c80-5336-4afb-b1d2-12be296100b2" ac:name="text-sort" ac:schema-version="1"> <ac:parameter ac:name="order">descending</ac:parameter> <ac:parameter ac:name="">comment:creation date</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="757d5ce9-6f6c-4079-ba2a-2962399c29cf" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Page</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="b5be5382-8892-419b-b766-460281736c9e" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">content:page</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="b9c82afd-f576-4352-b19b-ccc793daab8b" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Comment</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="baaf8229-438f-40c9-8d20-7acfd35951c8" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="render">richtext</ac:parameter> <ac:parameter ac:name="">content:body</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="192b97cc-e68c-46f3-b183-b9b58fe3440a" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Comment Type</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="43136f98-e1d9-4c87-8192-82310763eb33" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">comment:comment-type</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="4e5887b0-516d-48c9-bd5a-7147ce71fb0c" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Inline Comment Highlighted Text</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="bcc9f2fc-6c12-4390-8111-4bb921e06b17" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">comment:inline-selection</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="a2fb23b2-3cd3-4adc-849e-6ea4e448d6d6" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Inline Comment Status</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="3d950c47-e5c1-4842-ba8b-c62aa536255d" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">comment:inline-status</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="4bca3fc4-47df-45ee-9322-09e735442863" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Comment Author</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="949c6b97-9c22-4721-a25b-150b552236fb" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">comment:creator</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="e0ffec20-e544-4c6d-9a3f-afe524b41c40" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="injected">true</ac:parameter> <ac:parameter ac:name="title">Days ago</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="52952d4d-d3ae-4ba0-8fe5-339c4bfb5f72" ac:name="report-eval" ac:schema-version="1"> <ac:parameter ac:name="format">#</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> <ac:plain-text-body><![CDATA[(%global:current date>date:milliseconds% - %comment:creation date>date:milliseconds%)/1000/60/60/24]]></ac:plain-text-body> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro>

 

Macro structure

You can recreate the example in the editor view:

Steps

  1. Create a Report Table macro.

  2. Within the Report Table macro, create a Content Reporter macro with Types: comment.

  3. Within the Content Reporter macro, create a Text Sort macro with Key: comment:creation date to automatically sort your report items by creation date.

  4. Create as many Report Column macros with Report Info macros as you want to 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:

Report Column macro parameters

Nested Report Info macro parameters

Report Column macro parameters

Nested Report Info macro parameters

Title: Page

  • Key: comment:page

  • Link to Item: selected

Title: Comment

  • Key: comment:body

  • Link to Item: selected

  • Render: richtext

Title: Comment Type

Key: comment:comment type

Title: Inline Comment Highlighted Text

  • Key: comment:inline-selection

  • Link to Item: selected

Title: Inline Comment Status

Key: comment:inline-status

Title: Comment Author

Key: comment:creator

  1. Optionally, to calculate the time elapsed since the comment was made:

    1. Create another Report Column macro with Title: Days agoand Injected: selected, because we are going to use an advanced notation.

    2. Within the Report Column macro, create a Report Eval macro with Format: # so the number of days will be rounded.

    3. Within the Report Eval macro body, enter the following notation for the calculation:

      (%global:current date>date:milliseconds% - %comment:creation date>date:milliseconds%)/1000/60/60/24