Show the latest modification dates for all spaces
Scenario
As an administrator or content manager on a Confluence instance with a lot of content, you may want to know which spaces are becoming obsolete.
This recipe lets you show the dates and times of all spaces when they were last touched by a user (commented, new additions, modified, etc.).
This recipe may take a while to load results if your instance has a large number of spaces or pages. You may want to limit it to specific spaces.
Result
Recipe
Apps | Reporting for Confluence Data Center |
|---|---|
Level | Easy |
Estimated time | 15 minutes |
Macros | Combining Reporter, Content Reporter, Date Sort, Repeat Filter, Report Column, Report Info, Report Table, Text Filter, Text Sort |
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="356f269f-552c-405b-aa59-61745bdb8ec6" ac:name="report-table" ac:schema-version="1">
<ac:rich-text-body>
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="4ac2f5e5-7886-438f-b9c5-c2944b6fd13a" ac:name="combining-reporter" ac:schema-version="1">
<ac:rich-text-body>
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="d0fe9fa9-e108-49fd-9d8f-c8e49ee89113" ac:name="content-reporter" ac:schema-version="1">
<ac:parameter ac:name="spaces">
<ri:space ri:space-key="@all" />
</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="6d3596e9-dcfa-4cb9-bc7d-c4c09d7a7d1f" ac:name="text-filter" ac:schema-version="1">
<ac:parameter ac:name="required">true</ac:parameter>
<ac:parameter ac:name="">content:space</ac:parameter>
</ac:structured-macro> <ac:structured-macro ac:macro-id="c9ab9f36-23d1-4d68-8d8c-f75cfed676af" ac:name="text-sort" ac:schema-version="1">
<ac:parameter ac:name="">content:space</ac:parameter>
</ac:structured-macro> <ac:structured-macro ac:macro-id="42de1ec7-6f7f-44f0-87cc-602169f783a6" 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:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="04e44dce-093b-40ad-9a80-13f2c75f4ca7" ac:name="repeat-filter" ac:schema-version="1">
<ac:parameter ac:name="match">first</ac:parameter>
<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="cb214b42-0a70-4e25-8da6-b31706d843ed" 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="eee7d0e3-5e13-465f-8ca7-e76db7f39d3e" 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="c0f72f1f-1726-404d-8aab-f1027d2950be" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Content</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="fb4d86ec-569b-4cde-813f-4bdf059ef140" 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:structured-macro ac:macro-id="61388a67-c993-4758-bcf9-7f40b3cba10e" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Last Modified</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="1c68f34e-3c40-4751-af75-242764d7054c" 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:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br />
</p>
Macro structure
You can recreate the example in the editor view:
Line-by-line explanation
Steps | Description |
|---|---|
1 | The Report Table macro formats the report as a table. |
2 | The Combining Reporter macro encloses the Content Reporter macro and the Repeat Filter macro. Therefore, it takes the results list of contents retrieved from the Content Reporter macro to be filtered via the Repeat Filter macro |
3 | The Content Reporter macro, with Spaces: Using Spaces: |
4 | The Text Filter macro, with Key: |
5 | The Text Sort macro, with Key: |
6 | The Date Sort macro, with Key: |
7 | The Repeat Filter macro, with Key: |
8 | Three Report Column macros create three columns with titles |
9 | The Report Info macro, with Key: |
10 | The Report Info macro, with Key: |
11 | The Report Info macro, with Key: |