Show pages without updates for a period specified from a Scaffolding dropdown list

Show pages without updates for a period specified from a Scaffolding dropdown list

Scenario

The following recipe generates a dynamic report to find dormant or outdated pages that are not actively edited for a period of time specified from a Scaffolding dropdown list.

Result

Recipe

Apps

Reporting for Confluence 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 &gt; date:shift -6m &gt; 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 &gt; date:shift -1y &gt; 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 &gt; date:shift -2y &gt; 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 &gt; date:shift -3y &gt; 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&gt;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

  1. Create a List Data (from the Scaffolding app) macro with Field Name: myList and Required: selected.

  2. Within the List Data macro, create multiple List Option (from the Scaffolding app) macros with different values and labels, for example:

    • Value%global:current date > date:shift -6m > date:dd-MMM-yyyy% and Label: Six Months.

    • Value%global:current date > date:shift -1y > date:dd-MMM-yyyy% and Label: One Year.

    • Value%global:current date > date:shift -2y > date:dd-MMM-yyyy% and Label: Two Years.

    • Value%global:current date > date:shift -3y > date:dd-MMM-yyyy% and Label: Three Years.

  3. Outside the List Data macro, create a Report Table macro with Injected: selected.

  4. Within the Report Table, create a Content Reporter macro with the following parameters:

    • Space: @all

    • Types: pages

  5. Within the Content Reporter macrocreate a Date Filter macro with the following parameters:

    • Key: content:modification date

    • Required: selected

    • Format: dd-MMM-yyyy

    • Maximum Value: %data:myList>collection:first%

  6. Within the Report Table macro, under the Content Reporter macro, create a Report Column macro with Title: Page Title.

  7. Within the Page Title Report Column macro, create a Report Info macro with the following parameters:

    • Key: content:title

    • Link To Item: selected

  8. Under the Page Title Report Column macro, create another Report Column macro with Title: Created.

  9. Within the Created Report Column macro, create a Report Info macro with the following parameters:

    • Key: content:creation date

    • Link To Item: selected

    • Format: dd-MMM-yyyy

  10. Under the Created Title Report Column macro, create another Report Column macro with Title: Updated.

  11. Within the Updated Report Column macro, create a Report Info macro with the following parameters:

    • Key: content:modification date

    • Link To Item: selected

    • Format: dd-MMM-yyyy

  12. Under the Updated Title Report Column macro, create another Report Column macro with Title: Author.

  13. Within the Author Report Column macro, create a Report Info macro with the following parameters:

    • Key: content:creator

    • Link To Item: selected

  14. Under the Author Title Report Column macro, create another Report Column macro with Title: Modifier.

  15. Within the Modifier Report Column macro, create a Report Info macro with the following parameters:

    • Key: content:modifier

    • Link To Item: selected