List pages where last mod date is prior to X months ago?

So, if I wanted to pull a list of pages that were last updated prior to, let's say, 6 months ago, is there a way of doing this using the SQL plugin (Or any other way for that matter)?

I'm hoping that instead of putting a specified date I can set up a function so that I get a list of pages that are always over 6 months old. Instead of always having to change the date, I'd prefer to have it be a rolling constant.

Thus far I've been scavenging/stealing SQL script from here and other sites and modifying it somewhat. Just missing this piece of the puzzle. I'm assuming/hoping that this is just a really simple solution that i'm in the dark about. Any assistance or direction is greatly appreciated. Thank you.

{sql:jndi=confluence}
select c.lastmoddate, c.TITLE, c.VERSION, c.CREATOR, c.CREATIONDATE, s.spacename from
 "Confluence"."dbo"."CONTENT" c,
"Confluence"."dbo"."SPACES" s
where c.spaceid = s.spaceid and s.spacename='Knowledge Portal' and 
contenttype='PAGE' and content_status='current'
order by lastmoddate desc
{sql}



3 answers

1 accepted

Hi Patrick,

To do that you can use the plugin Reporting from Customware.

With the following code you should cover your question:

{report-list}
{content-reporter:space=KEYOFYOURSPACE|types=page}
{date-filter:page:modification date|beforeValue=-6m}
{content-reporter}
{report-body}

Last modification:{report-info:page:modification date}, Title: {report-info:page:title}, Last version: {report-info:page:latest version}, Creator: {report-info:page:creator}, Creation date: {report-info:page:creation date}, Space name: {report-info:page:space > content:name}

{report-body}
{report-list}

Regards

Cyrille

Cool, does what I need, thanks!

What would I need to add to the above markup to only show pages that the creator has created, not all pages?

What would I need to add to the above markup to only show pages that the creator has created, not all pages?

Archiving Plugin provides configurable rules for reporting pages not viewed in the last N days or not updated in the last M days. There is no need to program anything, the whole thing runs automagically.

You define the period as number of days, and it is a "rolling constant". Note: there is a ton of other features you may be interested in (archiving the outdated pages, consistently configuring the rules for hundreds of spaces, etc.)

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

364 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you