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

Patrick Illian August 29, 2012

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

1 vote
Answer accepted
Cyrille Martin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2012

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

Patrick Illian August 30, 2012

Cool, does what I need, thanks!

Martrice Denson June 19, 2014

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

0 votes
Midori
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 25, 2014

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.)

0 votes
Martrice Denson June 19, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events