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.
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.
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($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:
#foreach( $version in $allVersions )
#set( $allContributers=$version.getContributorSet() )
#foreach( $user in $allContributers)
And now, I have to iterate over all subpages, which should also be possible somehow :)
since I know you're a PocketQuery user, you could try using this Query:
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.
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
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
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.
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.
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. :)
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