Showing Pages without Recent Update
Scenario
The following recipe generates a report to find dormant or outdated pages that are not actively edited for a period of time.
Result
Recipe
Apps | Reporting for Confluence Server & Data Center, Scaffolding |
---|---|
Level | Easy |
Estimated time | 15 minutes |
Macros | Content Reporter, Date Filter, Report Column, Report Info, Report Table |
Suppliers | Date Supplier, Report Supplier |
Storage format
You can copy and paste this code into the Confluence Source Editor:
<p class="auto-cursor-target">Choose last modification date:</p>
<table class="relative-table wrapped" style="width: 47.1257%;">
<colgroup>
<col style="width: 99.9664%;"/>
</colgroup>
<tbody>
<tr>
<th>Unmodified pages since</th>
</tr>
<tr>
<td>
<div class="content-wrapper">
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="db0eef72-b63a-4e75-9f7f-5c00492b4ad7" ac:name="list-data" ac:schema-version="1">
<ac:parameter ac:name="name">myList</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="24503308-35d6-4373-9f78-6cd9abee0b1f" ac:name="list-option" ac:schema-version="1">
<ac:parameter ac:name="label">Six Months</ac:parameter>
<ac:parameter ac:name="value">%global:current date > date:shift -6m > date:dd-MMM-yyyy%</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="c669e535-393a-452c-83f5-3c8e8d1486a4" ac:name="list-option" ac:schema-version="1">
<ac:parameter ac:name="label">One Year</ac:parameter>
<ac:parameter ac:name="value">%global:current date > date:shift -1y > date:dd-MMM-yyyy%</ac:parameter>
<ac:rich-text-body>
<pre>
<br/>
</pre>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="90847750-ff63-4f20-a6bf-eb45c6a07419" ac:name="list-option" ac:schema-version="1">
<ac:parameter ac:name="label">Two Years</ac:parameter>
<ac:parameter ac:name="value">%global:current date > date:shift -2y > date:dd-MMM-yyyy%</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="45169d98-384c-4f37-aa87-b730925facce" ac:name="list-option" ac:schema-version="1">
<ac:parameter ac:name="label">Three Years</ac:parameter>
<ac:parameter ac:name="value">%global:current date > date:shift -3y > date:dd-MMM-yyyy%</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</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>
</div>
</td>
</tr>
</tbody>
</table>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="6035de7d-52a9-4877-9849-6be2cf13be6e" ac:name="report-table" ac:schema-version="1">
<ac:parameter ac:name="injected">true</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="1daa3fd4-fb21-41f3-9f78-f01cd70149b4" ac:name="content-reporter" ac:schema-version="1">
<ac:parameter ac:name="types">page</ac:parameter>
<ac:parameter ac:name="spaces">
<ri:space ri:space-key="CFSC"/>
</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="1b9f2b1b-8835-4653-bb19-80a7dc4da71f" ac:name="date-filter" ac:schema-version="1">
<ac:parameter ac:name="maxValue">%data:myList>collection:first%</ac:parameter>
<ac:parameter ac:name="format">dd-MMM-yyyy</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
<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="e605c374-4152-4ff6-8327-f5a75344b76d" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Page Tiltle</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="7eebf584-e9f3-4c64-a1e9-285f3d6bd0ad" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="link">true</ac:parameter>
<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="6ae3268b-e954-4f32-9363-68508bd14a0e" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Created</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="e165f198-39fb-4475-a739-d71de5eea2a1" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="format">dd-MMM-yyyy</ac:parameter>
<ac:parameter ac:name="link">true</ac:parameter>
<ac:parameter ac:name="">content:creation 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="5bfae41f-a512-4b92-ac42-a4a1960effb1" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Updated</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="9d0f8b23-13e0-422e-b130-a87750b6c336" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="format">dd-MMM-yyyy</ac:parameter>
<ac:parameter ac:name="link">true</ac:parameter>
<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="bca56207-383e-4890-806f-8fd66810e4c3" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Author</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="503b1e79-dff3-47ed-9a73-1314a1551395" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="link">true</ac:parameter>
<ac:parameter ac:name="">content:creator</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="b44c16ea-e728-489a-9392-465986a33ddc" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Modifier</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="03500f18-c64f-48ed-a222-e4e66da54d5f" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">content:modifier</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>
<br/>
</p>
<p>
<br/>
</p>
Macro structure
You can recreate the example in the editor view:
Steps
Create a List Data macro, and set its Name to "myList".
Within the List Data macro, create multiple List Options with different values as in the screenshot. Set Value toÂ
%global:current date > date:shift -1y > date:dd-MMM-yyyy%
Change the key "shift - 1y
" as desired (ie. -6m, -2y, or -10d). See Date Supplier.ÂÂ Now you can select the maximum date to for pages with updates.
Create Report Table macro and check the Injected parameter to set it to True.
Within the Report Table, create Content Reporter. Set the following parameters:
Space: "@all"
Types: "pages"Within Content Reporter macro, create Date Filter macro. Set the following:
Key:Âcontent:modification date
Required:Â "checked"
Format:Â "dd-MMM-yyyy"
Maximum Value:Â%data:myList>collection:first%
Within Report Table macro and outside Content Reporter macro, create Report Column macro and set Title to "Page Title" .
Within the Report Column macro, create Report Info. And set the following:
Key:Âcontent:title
Link To Item: "checked"Within Report Table macro and outside Content Reporter macro, create Report Column macro and set Title to "Created" .
Within the Report Column macro, create Report Info. And set the following:
Key:Âcontent:creation date
Link To Item:Â "checked"
Format: "dd-MMM-yyyy"Within Report Table macro and outside Content Reporter macro, create Report Column macro and set Title to "Updated" .
Within the Report Column macro, create Report Info. And set the following:
Key:Âcontent:modification date
Link To Item:Â "checked"
Format: "dd-MMM-yyyy"Within Report Table macro and outside Content Reporter macro, create Report Column macro and set Title to "Author" .
Within the Report Column macro, create Report Info. And set the following:
Key:Âcontent:creator
Link To Item: "checked"Within Report Table macro and outside Content Reporter macro, create Report Column macro and set Title to "Modifier" .
Within the Report Column macro, create Report Info. And set the following:
Key:Âcontent:modifier
Link To Item: "checked"Within Report Table macro and outside Content Reporter macro, create Report Column macro and set Title to "Created" .
Within the Report Column macro, create Report Info. And set the following:
Key:Âcontent:creation date
Link To Item:Â "checked"