Scenario
The following recipe filters a report based on Scaffolding date-data.
Result
Recipe
Apps | Reporting for Confluence Server & Data Center, Scaffolding |
---|---|
Level | Easy |
Estimated time | 10 minutes |
Macros | Content Reporter, Date Filter, Report Body, Report Column, Report Info |
Suppliers | Date Supplier, Page Supplier |
Storage format
You can copy and paste this code into the Confluence Source Editor:
<table class="wrapped"> <colgroup> <col /> <col /> </colgroup> <tbody> <tr> <th>Start date</th> <td> <div class="content-wrapper"> <ac:structured-macro ac:macro-id="64ee2ae9-985b-4823-b88e-c1983ae7e2ed" ac:name="date-data" ac:schema-version="1"> <ac:parameter ac:name="format">dd-MMM-yyyy</ac:parameter> <ac:parameter ac:name="name">startDate</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> </ac:structured-macro> </div> </td> </tr> </tbody> </table> <ac:structured-macro ac:macro-id="a34619da-8c00-451d-b192-dc1999cf23cd" ac:name="report-table" ac:schema-version="1"> <ac:parameter ac:name="injected">true</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="dbb522de-b13c-4a1c-aedd-f1c349367f81" ac:name="content-reporter" ac:schema-version="1"> <ac:parameter ac:name="types">page</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="86688962-192d-4698-8447-1c076d605777" ac:name="date-filter" ac:schema-version="1"> <ac:parameter ac:name="minValue">%data:startDate%</ac:parameter> <ac:parameter ac:name="format">E MMM dd HH:mm:ss z yyyy</ac:parameter> <ac:parameter ac:name="">page:creation date</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="73198392-1c61-41a9-a8cc-00bf8489274c" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Page Title</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="58c27c4f-8cfc-49f1-8cd2-92f380c06401" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">page:title</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="06af1c9f-f778-4c20-873e-ac3b8d20d6f9" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Created date</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="8fcbe15c-9bfa-422b-9399-ce8311d6b9b4" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="format">dd-MMM-yyyy</ac:parameter> <ac:parameter ac:name="">page:creation date</ac:parameter> </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
Add a Date Data macro
Create a Report Table macro.
Within the Report Table macro, create a Content Reporter macro.
Set the type to page
Tick the injection checkboxWithin the Content Reporter macro, create a Date Filter macro.
Set the Key parameter to page:creation date.
Set the format toE MMM dd HH:mm:ss z yyyy
Set the minimum date to%data:startDate%
Within the Report Table macro and under the Content Reporter macro, create a Report Column macro.
Set the Title parameter to Title.Within the Report Column macro, create a Report Info macro.
Set the Key parameter to page:title.
Check the Link to Item parameter.Back within the Report Table macro, create another Report Column macro.
Set the Title parameter to Created Date.Within the Report Column macro, create a Report Info macro.
Set the Key parameter to page:creation date.
Line-by-Line Explanation
N/A