Showing the Latest Modification Date of a Single Space

Scenario

Reporting allows you to see what spaces are active and what have lain dormant.

This recipe lets you find out when a space was last touched by a user (commented, edited, additions, etc.)

Note: The report may take some time to load depending on the volume of content to report on.

Result

  • N/A

 

Recipe

Apps

 

Reporting for Confluence Server & Data Center

 

Apps

 

Reporting for Confluence Server & Data Center

 

Level

Easy

Estimated time

10 minutes

Macros

Content Reporter, Date Sort, Report Column, Report Info, Report Table, Text Filter

Suppliers

Content Supplier

Storage format

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

<p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="61fe737f-49e5-4d22-999c-b8a9c9f7bd11" ac:name="report-table" ac:schema-version="1"> <ac:parameter ac:name="maxResults">1</ac:parameter> <ac:rich-text-body> <p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="829914d0-fc70-4065-8fd4-8fc3ec3b85c1" ac:name="content-reporter" ac:schema-version="1"> <ac:rich-text-body> <ac:structured-macro ac:macro-id="7294b566-ddd4-43f4-920f-468c91ba247b" ac:name="date-sort" ac:schema-version="1"> <ac:parameter ac:name="order">descending</ac:parameter> <ac:parameter ac:name="">content:modification date</ac:parameter> </ac:structured-macro> <ac:structured-macro ac:macro-id="1476996b-4ffa-4130-a521-f450857e60f4" ac:name="text-filter" ac:schema-version="1"> <ac:parameter ac:name="exclude">This Page Name</ac:parameter> <ac:parameter ac:name="">content:title</ac:parameter> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="30fabbb7-999e-4959-b4c5-e407f025bf8e" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Date</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="66db3667-1c14-4b23-b76c-8d946ae74bac" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">content:modification date</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="6b9f22c5-8f90-49e6-9d4c-ec1ed17e6741" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Space</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="d7568051-6552-43ca-98d4-b025cc2e61b1" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">content:space</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> <ac:structured-macro ac:macro-id="18372060-e37f-4a0a-bd57-03437516182f" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Last Modified Content</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="15124091-0e66-4b35-9865-dc1d70e7d52d" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">content:title</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"> <br /> </p>

 

Macro structure

You can recreate the example in the editor view:

 

 

 

Steps

Line

Description

Line

Description

1

The report will be formatted as a table using Report Table. maxResults field is set to '1', to display only the first (latest) content.

2

Content Reporter will be used to grab all the contents from the current space. The contents may be in the forum of pages, news and comments, etc.

3

In order to know which content has most recently modified, the contents were sorted according to date using Date Sort, setting supplier key to 'Content Supplier'. By setting field order to ascending, the first item of the collection of contents is the one we are looking for.

4

Text Filter will be used to exclude the current page, which when updated is technically the latest modified content. To avoid this, Text Filter excludes the current page from the list of contents pulled from Content Reporter to be evaluated. The exclude field of text-filter is set to the title of the current page and supplier key set to Content Supplier. On #1, having set maxResults to 1, this ensures that table will only show the first result.

5

Report Column is used to create individual columns, storing column title and report data. The titles of the three created columns are set to Date, Space and Last Modified Content, in that order.

6

Report Info is used to display the date of modification of the content retrieved by Content Reporter, setting supplier key to 'Content Supplier'.

7

Space name of the content retrieved by Content Reporter is displayed via Report Info, setting supplier key to 'Content Supplier'.

8

The title of the retrieved content is displayed via Report Info, setting supplier key to 'Content Supplier'.

 

Line-by-Line Explanation

  • N/A