Hello community
I would like to create a user macro, which shows me a change history of all subpages.
For that, I first tried to get a change history for just one page. But that doesn't semm possible.
I found this documentation: public interface Versioned
But as you can see, you can only access to the latest version.
Question
Is there any way to get all versions in a list?
Then I could extract informations like versionnummer, date, comment, editor.
And then I could display that as normal table.
Thanks for any help.
Regards, Dominic
I think I found a solution by my own.
There is a function for the pageManager.
To get the pageManager, this is the script
#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') )
And now I can get all Versions with "getVersionHistorySummaries"
#set( $allVersions=$pageManager.getVersionHistorySummaries($content) )
And now, I can make my table like this:
<table>
<tr>
<th>Datum</th>
<th>Version</th>
<th>Beschreibung</th>
<th>Link</th>
<th>Bearbeiter</th>
</tr>
#foreach( $version in $allVersions )
<tr>
<td>$version.getLastModificationDate()</td>
<td>$version.getVersion()</td>
#if($version.getVersionComment())
<td>$version.getVersionComment()</td>
#else
<td></td>
#end
<td>$version.getVersion()</td>
#set( $allContributers=$version.getContributorSet() )
<td>
#foreach( $user in $allContributers)
$user.getFullName()
#end
</td>
</tr>
#end
</table>
And now, I have to iterate over all subpages, which should also be possible somehow :)
Regards, Dominic
Hi Dominic,
since I know you're a PocketQuery user, you could try using this Query:
SELECT *
FROM CONTENT
WHERE CONTENTID = :@pageid
OR PREVVER = :@pageid
ORDER BY VERSION
Of course you probably want to write a custom template as well that renders the user keys into actual user links, etc. but I think this should get you the data you need.
Best regards,
Sven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sven
This is also a great idea! I didn't think of using PocketQuery for that! Nice!
I also found a solution with the confluence API.
But I will try this one, too. Thanks a lot
Regards, Dominic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you mean for the pocketquery?
I would do it like this:
You have to loop over all children from a page with a given pageid
GET /rest/api/content/{id}/child
And for every result you have to call the API again, for getting all childs of childs.
With that, use some template and converter action and you should be able to get it done. I have not implemented it via API nor via the PocketQuery SQL. But both would work I think.
Hope this helped
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike
Do you already have such a user macro or is this a plugin?
I'm not sure whether this is the thing I'm looking for. Because there you just have the pages with the version numbers.
I'm looking for a table with, where every version of a page is one row with version comment and change date.
For example, you have 3 subpages, every subpage has 5 versions. Then my table should show 15 rows with every version and every version comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dominic,
I am using a plugin called QC Document for Confluence Cloud.
It can't do what you require there with 15 rows. It is more for pulling the latest version from a page.
You do seem to have a lot more control using Confluence Server, I do wish I had more access to the data using the query tool.
Cheers,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Indeed you do have much more control over Confluence Server than over Cloud. This is typical for all On-Premise vs SaaS software. However this also comes with all the costs of running and maintaining the software, which shouldn't be underestimated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also regarding PocketQuery (if that's what you mean by query tool), It's still early days but we are actually working on a Cloud version! ;)
Of course in this case it wouldn't actually help, because you don't have direct access to the database of Confluence Cloud, but you could still use it for the REST API and build a custom report that way. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.