Reporting on content freshness
Asked by Rhyne Armstrong:

I have the Reporting and Scaffolding plugin. I would like to display a certain text or image based on the relative freshness of an article in our Knowledge Base. For example, a green check if it was last modified in the last three months, or a red X if it has been a year since it was modified.

I don't want to filter the content OUT, just warn the reader that it might be old.

I know how to grab the modified date, but I can't figure out:

a) How to evaluate a date in a report.

b) How to put that evaluation into good use.


Answers:
author: Sayed Bares [ServiceRocket]
body: Hi Rhyne,

That is a very good use case :)

I tried to solve it by using nested reporters (report inside another report) and it worked, here is the storage format (to import it in your Confluence you can follow instructions mentioned in [this documentation](https://community.atlassian.com/t5/Confluence-discussions/How-to-import-storage-format/td-p/970905)):

```
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="073eb22c-8932-42e8-96e6-5dd8c44e5806" 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="13eefa5e-cdb3-4bb4-b44d-942706bf7564" ac:name="content-reporter" ac:schema-version="1">
<ac:parameter ac:name="types">page,attachment</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="87573cb8-2fd3-4920-94f7-735a9becb710" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Icon</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="f7bde38d-d930-45b3-9065-7632a8cabc37" ac:name="report-block" ac:schema-version="1">
<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="64a5ee94-b7ba-4550-8e4a-d3b092e81b82" ac:name="local-reporter" ac:schema-version="1">
<ac:parameter ac:name="">@self</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="88c791bb-a24b-4df8-843d-dbaf72a566fc" ac:name="date-filter" ac:schema-version="1">
<ac:parameter ac:name="afterValue">-3M</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="01a16e1b-4905-4d25-8f71-3be3aa1c21c4" ac:name="report-body" ac:schema-version="1">
<ac:rich-text-body>
<p>
<ac:emoticon ac:name="tick"/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="c112ceff-3f7e-4007-836d-9ba1b3f96071" ac:name="report-empty" ac:schema-version="1">
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="00c67408-d5aa-474f-90df-bdecf4344147" ac:name="report-block" ac:schema-version="1">
<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="3172835d-4c85-4e6b-90d2-b00fa9aa26dd" ac:name="local-reporter" ac:schema-version="1">
<ac:parameter ac:name="">@self</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="ac187b60-2321-4221-ba3d-f617653667a3" ac:name="date-filter" ac:schema-version="1">
<ac:parameter ac:name="beforeValue">-1y</ac:parameter>
<ac:parameter ac:name="format">dd-MMM-yyyy</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="465c8f0d-a88e-4808-b93e-9794ca6633f5" ac:name="report-body" ac:schema-version="1">
<ac:rich-text-body>
<p>
<ac:emoticon ac:name="cross"/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="2f6ae980-380e-4add-ae64-e5000c978d67" ac:name="report-empty" ac:schema-version="1">
<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>
</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>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="592b3fd8-bf0d-40ad-ab6a-d9cbbb25b092" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Modification Date</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="6bcd9bed-5403-44d9-af08-a964b637b32c" 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="2405939c-dbf2-4f43-8145-11beb6fe6a9c" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Title</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="a63050bb-362b-474a-95bb-f98df65c8562" 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:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>
```

**Results:**

**![old.png](https://community.atlassian.com/t5/image/serverpage/image-id/104177i6FA0EE391AEFA7EC/image-dimensions/398x176?v=v2 "old.png")![new2.png](https://community.atlassian.com/t5/image/serverpage/image-id/104178iBBA63C23222EA539/image-dimensions/394x267?v=v2 "new2.png")**

And to answer your questions:

***a) How to evaluate a date in a report.***

You can do that by using date filter macro and [this is the full documentation](https://docs.servicerocket.com/reporting/macro-reference/date-filter).

***b) How to put that evaluation into good use.***

You can use nested Reporters to show the output you are interested in, which I used in the above example.

Hope that helps and let me know if you have any questions.

Best,

Sayed

comments: author: Karen Feldman
body: Hi! I'd also love this and don't have any plug ins installed. How do I go about setting this up from nothing? :) thank you!


author: Sayed Bares [ServiceRocket]
body: Hi Karen,

To set up this, you will just need to install [Reporting](https://marketplace.atlassian.com/apps/186/reporting-for-confluence?hosting=server&tab=overview) add-on (paid app) which is used for creating the Report and [Source Editor](https://marketplace.atlassian.com/apps/1210722/confluence-source-editor?hosting=server&tab=overview) add-on (free app) which is used for importing storage formats. After installation, import the above storage format by following [this documentation.](https://community.atlassian.com/t5/Confluence-discussions/How-to-import-storage-format/td-p/970905)

You can create more reports and understand how Reporting macros work by going through [this documentation](https://docs.servicerocket.com/display/REP/Reporting+for+Confluence) and if you ever need help our [support team](https://atlassian.servicerocket.com/) is here for you :)

Best,

Sayed


Tags: confluence-server

report

scaffolding

server