Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence document Expiration date

Genevieve Senecal July 9, 2013

Is it possible to add an expiration date or define a date for a document to be review? For example I create a document but want to make sure this document is review every 3 month. Thank you

2 answers

1 accepted

2 votes
Answer accepted
Matthew J. Horn
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.
July 9, 2013

This plugin seems to do some of what you're asking:

https://marketplace.atlassian.com/plugins/com.midori.confluence.plugin.archiving

2 votes
John Corwith July 14, 2016

I don't have easy access to the marketplace so I have to use home grown solutions as much as possible.

I used the Page properties macro, with a Page Properties ID of exp. (Hide or don't hide depending on whether or not you want to see the expiration date on your page.)

In the body of the macro, I created a 1 row, 2 col table with the left column the header and the heading Expires.

Finally I put the Label exp on each page.

 

Next create a page and include the Page  properties report macro with the Label exp, in the Current space (or wherever) with the Options: Page properties ID exp and Sort by Expires.

 

This will produce a report showing the page titles (and links to them) and expiration date, with the most recent expiration dates at the top.

 

It doesn't highlight pages older than a given date but that's pretty easy to manage in your head and this solution is free.

 

I also wanted to alert page visitors to the fact that the content had expired (or was soon to) so I created a macro based on one by Fermo Siegwart's Date Countdown macro.

 

Macro Name: pageexiirationtimer

Visible: all

Macro Title: Page Expiration Timer

Description: Counts down the number of days until the page expiration date.

Macro Body Processing: Unrendered

TEMPLATE

## Macro title: Page Expiration Timer

## Macro has a body: Y (can contain instructions to user in the event the doc is expired.)

## Body processing: optionally display email address for author/editor and instructions.

## Developed by: John Corwith, adapted from Femo Siegward Date Countdown macro

## Date created: 07/12/2016

## This user macro counts down the number of days until the page expiration date.

## @param endDate:title=Page Expiration Date|type=date|required=true|desc=Format: mm/dd/yyyy

## @param displayCountdown:title=Display Countdown Banner|type=boolean|default=true|desc=Permits the countdown banner to be hidden until the expiration date.

## @param contentType:title=Page Content Type|type=string|required=true|desc=Page/Instructions/Wiki/...

## @param notifyText:title=Email Link Text|type=string|required=false|desc=Notify Administrator/Email/Report Expired Page/... (requires Email Address below)

## @param email:title=Email Address|type=string|required=false|desc=DL or email address (requires Email Link Text above)

 

## declare variables and initialize with current date

#set ( $endDate = $content.currentDate)

#set ( $currentDate = $content.currentDate)

 

## parse endDate param to milliseconds and set as time of endDate variable

$endDate.setTime($content.currentDate.parse($paramendDate))

 

#if($currentDate.before($endDate))

#if($paramdisplayCountdown == "true")

## currentDate is before endDate => calculate days remaining

#set ( $daysRemaining = ($endDate.getTime() - $currentDate.getTime()) / 1000 / 2600 / 24 )

<div class="aui-message success">

<big><big>$paramcontentType expires in $daysRemaining days on $action.dateFormatter.format($endDate).</big></big>

</div>

#end

#else

## currentDate is after endDate

<div class="aui-message error">

<big><big>$paramcontentType <strong><font color="red">Expired</font></strong> on $action.dateFormatter.format($endDate).</big></big>

#if($paramnotifyText)

## optional link to email for concerning expired page

<a href="mailto:$paramemail?subject=$renderContext.getPageTitle():$paramcontentType has EXPIRED&body=$action.getGlobalSettings().getBaseUrl()$content.geturlPath()">$paramnotifyTExt</a>

#end

## macro body can optional contain instructions for the user in the event the page has expired

$body

</div>

#end

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events