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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

1 vote
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)

Thanks,

Ann

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

###CONVERTS THE PARAM STRINGS TO DATE FOR COMPARING
#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)
#else
#set ($year = $generalUtil.convertToInteger("$part"))
#end

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

###CONVERTS THE PARAM STRINGS TO DATE FOR COMPARING
#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)
#else
#set ($year = $generalUtil.convertToInteger("$part"))
#end

#set ($i = $i + 1)
#end
$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()) )


###GET ALL VERSIONS FOR FURTHER OPERATIONS
#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) )
#end
#end
#end

#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) )
#end
#end


###CHECK IF THE PARAMS AREN'T EMPTY
#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>
<ac:rich-text-body>
#if( $paramlatest == true)
<h1>Latest Version</h1>
#table( $latestVersions, $startDate, $endDate )
#elseif ($paramlatest == false )
<h1>All Versions</h1>
#table( $allVersions, $startDate, $endDate )
#end
</ac:rich-text-body>
</ac:structured-macro>
#end

#macro( table $versions, $startDate, $endDate )
<table id="myTable">
<tr>
<th>Date</th>
<th>Version</th>
<th>Link</th>
<th>Version Comment</th>
<th>Editor</th>
<th>Actual Version</th>
</tr>
#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()) )
<tr>
<td>$modDate</td>
<td>$version.getVersion()</td>
<td><a href="$page.getUrlPath()">$page.getDisplayTitle()</a></td>
#if($version.getVersionComment())
<td>$version.getVersionComment()</td>
#else
<td></td>
#end

#set( $allContributers=$version.getContributorSet() )
<td>
#foreach( $user in $allContributers)
$user.getFullName()
#end
</td>

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

323 views 23 8
Join discussion

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