Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Show Page Revision History for Parent & Children - Single View

Does anyone know if there is a way to show page revision history (macro) for all pages in a tree (Parent & Children) in a single view. It seems that the page revisions only get down to the page level, but I'd like show changes at the parent level. 

2 answers

1 accepted

2 votes
Answer accepted
AnnWorley Atlassian Team Jan 30, 2018

Hi Daniel,

We don't have a macro bundled with Confluence that will show the details of the page revisions of child pages. We have this suggestion ticket open: Ability to include Children in Change-History Macro The ticket is public so you can comment or vote on it to emphasize your use case. If you do vote or comment you will be added to email notifications for it.

In case it helps, the Contributors Summary macro can be set to show who has revised pages beneath and including the parent page:

The default scope for this macro is an individual page, but this can be extended to include the immediate children or descendants of a specified page. The statistics cover the following types of contributions:

edits to the page(s)
comments added to the page(s)
labels added to the page(s)
people watching the page(s)



0 votes
Dominic Lagger Community Leader Dec 18, 2019

Hi @Daniel Ross 

Since you are on confluence server, you could use a user macro. I wrote one for myself. 

Perhaps it helps you, perhaps not :) Let me know, if this is what you searched for. 

Here is the code:

## Macro title: Dominic
## Macro has a body: N
## Developed by: Dominic
## Date created: 05/12/2019
## Installed by: Dominic

## This is an example macro
## @param latest:title=Just the last version|type=boolean|desc=If ticked, it shows only the latest version.
## @param startDate:title=Start Date|type=date|required=true|desc=Format: dd.MM.yyyy
## @param endDate:title=End Date|type=date|required=true|desc=Format: dd.MM.yyyy

#set( $startDate = $action.dateFormatter.getCalendar())
#set( $parts = $paramstartDate.split("[.]") )
#set ($i = 0)
#foreach ($part in $parts)
#if ($i == 0)
#set ($day = $generalUtil.convertToInteger("$part"))
#elseif ($i == 1)
#set ($month = $generalUtil.convertToInteger("$part"))
#set ($month = $month - 1)
#set ($year = $generalUtil.convertToInteger("$part"))

#set ($i = $i + 1)
$startDate.set($year, $month, $day, 0, 0, 0)

#set( $endDate = $action.dateFormatter.getCalendar())
#set( $parts = $paramendDate.split("[.]") )
#set ($i = 0)
#foreach ($part in $parts)
#if ($i == 0)
#set ($day = $generalUtil.convertToInteger("$part"))
#elseif ($i == 1)
#set ($month = $generalUtil.convertToInteger("$part"))
#set ($month = $month - 1)
#set ($year = $generalUtil.convertToInteger("$part"))

#set ($i = $i + 1)
$endDate.set($year, $month, $day, 0, 0, 0)

#set( $containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )
#set( $getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null) )
#set( $containerManager=$getInstanceMethod.invoke(null,null) )
#set( $containerContext=$containerManager.containerContext )
#set( $pageManager=$containerContext.getComponent('pageManager') )
#set( $page = $pageManager.getPage($content.getId()) )

#set( $latestVersions = [] )
###set( $dummy = $latestVersions.add($content.getLatestVersion()) )

#set( $allVersions=[] )
#foreach( $child in $page.getDescendants() )
#set( $childVersions = $pageManager.getVersionHistorySummaries($child.getEntity()) )
#foreach( $childVersion in $childVersions)
#set( $modDateTimeMillis = $childVersion.getLastModificationDate().getTime() )
#if( $modDateTimeMillis > $startDate.timeInMillis and $modDateTimeMillis < $endDate.timeInMillis)
#set( $dummy = $allVersions.add($childVersion) )

#foreach( $version in $allVersions )
#set( $versionPage = $pageManager.getPage($version.getId()) )
#set( $modDateTimeMillis = $versionPage.getLastModificationDate().getTime() )
#if( $modDateTimeMillis > $startDate.timeInMillis and $modDateTimeMillis < $endDate.timeInMillis)
#set( $dummy = $latestVersions.add($version) )

#if( $paramstartDate and $paramendDate)
<ac:structured-macro ac:name="expand" ac:schema-version="1" ac:macro-id="0662921b-d1ae-47f1-8502-5500fea7d1c8">
<ac:parameter ac:name="title">Change History ($paramstartDate - $paramendDate)</ac:parameter>
#if( $paramlatest == true)
<h1>Latest Version</h1>
#table( $latestVersions, $startDate, $endDate )
#elseif ($paramlatest == false )
<h1>All Versions</h1>
#table( $allVersions, $startDate, $endDate )

#macro( table $versions, $startDate, $endDate )
<table id="myTable">
<th>Version Comment</th>
<th>Actual Version</th>
#set( $alreadyPrintedVersions = [] )
#foreach( $version in $versions )
#set( $modDate = $version.getLastModificationDate() )
#set( $modDateTimeMillis = $version.getLastModificationDate().getTime() )
#set( $modDate = $action.dateFormatter.formatGivenString("dd.MM.yyyy", $modDate) )
#set( $page = $pageManager.getPage($version.getId()) )

#if(!$alreadyPrintedVersions.contains($page.getLatestVersionId()) )
<td><a href="$page.getUrlPath()">$page.getDisplayTitle()</a></td>

#set( $allContributers=$version.getContributorSet() )
#foreach( $user in $allContributers)

#set( $latestVersion = $page.getLatestVersion() )
<a href="$latestVersion.getUrlPath()">V$latestVersion.getVersion(): $latestVersion.getDisplayTitle()</a>
#set( $dummy = $alreadyPrintedVersions.add($page.getLatestVersionId()) )

Is there anything for this for Confluence Cloud?

Hello @Dominic Lagger 

thanks a lot, great macro !

i'm trying to customize it to reoder the columns, a bit tricky.

Also, the sort by date does not work, odd ?

Dominic Lagger Community Leader May 02, 2021

Handle dates in velocity is horror... 

So I do not know any good solution for this

I fixed my issue by using the yyyy-mm-dd format in the macro, thanks :)

Like Dominic Lagger likes this

Hello @Dominic Lagger 

I tried to include this macro to add a new column with the path to page :

But I must have missed smtg as it is always the current path of my main page which is displayed : would you please have an advise for this ?

Thanks :-)

Dominic Lagger Community Leader May 06, 2021

Hi @Sylvain Leduc 

Sorry, but can you explain in detail what you want to achieve? I do not understand...

@Dominic Lagger 

I want to add a column 'path to page' in the existing macro you developed.

This column will display the related path.

Dominic Lagger Community Leader May 06, 2021

Hi @Sylvain Leduc 

This should be possible with this already existing line

<a href="$page.getUrlPath()">$page.getDisplayTitle()</a>

Here you get the URL to the page.

Or am I still confused and you need something else? What you mean by "path to page"? Which path? Can you make an example? 

Sorry for my confusion...

Thanks, regards, Dominic

Hello @Dominic Lagger 

Yes this part shows the link but what I would need is to show the full directory path of the page like "parent page/child page/sub child page/etc/current page", do you know what i mean ? :)

Dominic Lagger Community Leader May 07, 2021

Ok, I think you mean "breadcrumbs navigation" :) 

I'm not having the perfect solution, but a hint:


Documentation of getAncestor() 

This will get you a list of every ancestor. 

Hope this helps :) 

Regards, Dominic

Like Sylvain Leduc likes this

Thanks for the tip !

Hi, I just stumbled across this macro when researching solutions for a client's new requirements and it is fantastic!

However, I do have one question, is there any way to also include the Parent page information within the table? 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

79 views 0 0
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you