Finding when Pages were Last Updated in a Set of Child Pages
Asked by Mick Davidson:

I'm in the process of archiving pages in a space and am running a date search to find pages that were created between certain dates. For example:

* modified:\[20130101 TO 20130731\]

What I would also like to do is run a similar search on a page and all its child pages to find which was the most recently edited.

Is this possible?

In an ideal world, I'd like to be able to find out when *each* child page was last edited.

At the moment the only way I can see of doing either of these things is by looking manually, which is far too inefficient and tedious given the 1000s of pages I have to check.

Cheers.


Answers:
author: Midori
body: You should automatically generate this report with the [Archiving Plugin](https://marketplace.atlassian.com/plugins/com.midori.confluence.plugin.archiving).

This plugin displays a so-called [Content Quality report](http://www.midori-global.com/products/confluence-archiving-plugin/documentation/#statistics) which will calculate and list the pages not updated in the recent N days. The *age* of the page is calculated recursively (propagating upwards), this is what you originally asked for, if I'm not mistaken. See a sample report below.

Even better, the plugin will also help you to [archive the pages](http://www.midori-global.com/products/confluence-archiving-plugin/documentation/page-archiving) that are not updated and/or not viewed.

And it features a fully automated "set it up and forget it" approach, which scales nicely to thousands of pages.

content-quality-statistics.png  
[](https://community.atlassian.com/t5/Confluence-questions/Finding-when-Pages-were-Last-Updated-in-a-Set-of-Child-Pages/qaq-p/27391?attachment-id=8414){#link_118a9798c9b0ea}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/4663/1/content-quality-statistics.png){#display_118a9798c9b0ea_0}


author: Matthew J. Horn
body: Ok, maybe you can try this user macro (put it on all your pages, in a Layout Decorator). You can hide it by wrapping an IF statement around it that checks against a user type (like admin), your username, or some other comparison.

```
## Macro title: Recently Updated Children#### Developed by: Matthew J. Horn## Date created: 01/16/2014## Installed by: ______## Description: Lists all children and their timestamps. Similar to "Recently Updated" macro, except it only applies to child pages of the current page. It's a combination of "Recently Updated" and "Children Display".## @noparams#set ($pageListArray = [])#set ($rootPage = $content)#macro ( process $rp )## note: Not sure what diff is between getChildren() and getSortedChildren()  -- "sort" is not by timestamp  #set ($pagelist = $rp.getSortedChildren() )  ## returns List&lt;Page&gt;  #foreach( $child in $pagelist )    #set($p = $pageListArray.add( $child ) )    #if( $child.hasChildren() )      #process ( $child )    #end  #end#end#process ( $rootPage )&lt;table class="confluenceTable"&gt; &lt;tbody&gt; &lt;tr&gt;  &lt;th class="confluenceTh"&gt;Title&lt;/th&gt;  &lt;th class="confluenceTh"&gt;Version&lt;/th&gt;  &lt;th class="confluenceTh"&gt;Mod Date&lt;/th&gt;  &lt;th class="confluenceTh"&gt;Modifier&lt;/th&gt; &lt;/tr&gt; #foreach( $child in $pageListArray)   ## child is of type Page   &lt;tr&gt;     &lt;td class="confluenceTd"&gt;$child.getTitle()&lt;/td&gt;     &lt;td class="confluenceTd"&gt;$child.getVersion()&lt;/td&gt;     &lt;td class="confluenceTd"&gt;$child.getLastModificationDate()&lt;/td&gt;          &lt;td class="confluenceTd"&gt;$child.getLastModifierName()&lt;/td&gt;   &lt;/tr&gt; #end &lt;/tbody&gt;&lt;/table&gt;
```

Let me know if this does what you want. It sounds like you want to integrate this with a date range search, but I haven't quite gotten my head around how to do that yet.

matt

comments: author: Matthew J. Horn
body: And a quick note, this does not include sorting in the macro. But tables in Confluence can be sorted on any column with a mouse click, as of Confluence 4.3.something...


author: Mick Davidson
body: Matthew,

Thanks for all your efforts on this. I've given this to our IT team but we've been having some issues recently (Confluence and non-Confluence) that has meant we still haven't tried it. I'll let you know what happens when we do.

Cheers.


author: Matthew J. Horn
body: For 1,000s of pages, I would definitely look into using the SQL plug-in:

<https://marketplace.atlassian.com/plugins/org.swift.confluence.sql>

comments: author: Mick Davidson
body: Thanks Matthew,

Yes, I wasn't clear there was I? :) I mean that in the space there's 1000s of pages, but using my modified search, I'll find a page within a group of related child pages.

Often the head page won't have been edited since it was created, but the others might have been.

So I'm not looking through 1000s in one go, I'm looking at a group that might be ten or twenty strong.

Cheers.


author: Matthew J. Horn
body: Ok, in that case I would write a User Macro because it sounds like you're going to want to show the your info on many pages (maybe "parent nodes" of small groups of sub pages)?

Lessee, maybe an "illustration" would make this clearer:

[](http://yuml.me/89832755)<http://yuml.me/89832755>

In this image, the second "row" (Topics 1, 2, and 3) is where you want to put your macro. Is this about right?


author: Mick Davidson
body: Matthew,

Yes, that's right. All I want to do is ID the last edited page so I can go straight to it to see who edited it.

The info doesn't need storing or displaying to anyone else. It's all mine... :)


author: Matthew J. Horn
body: Sorry to keep belaboring the point, but figuring out exactly what you want to do determines the best way to do it. (By best, I mean most performant and easiest...)

If I understand you correctly, you want to ID the last edited page within each "child group" (the Topics 1-3 in the image)? Is that correct?

Are these known pages (do you know the page names or IDs of the pages?), or do you need to sniff them out as well?


author: Mick Davidson
body: Sorry if I'm not being clear, thanks for sticking with me. :)

"If I understand you correctly, you want to ID the last edited page within each "child group" (the Topics 1-3 in the image)? Is that correct?"

Yes, that's right.

They are known to me because they, the pages, come up in the results from my date search.


author: Matthew J. Horn
body: Sorry, now I'm the one being unclear: are the ***parent*** pages known to you? In other words, Topic 1 is a parent page with 10 child pages. You want to find the most recently edited page of the children of Topic 1, correct? How many "Topic 1s" are there? And do you have a list of them somewhere?


author: Mick Davidson
body: Yes, but only because I find the child page, then see what the parent is called.

I then check that to see when it was last updated. It's a very manual process. :)

Cheers.


Tags: child-page

search