You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi all,
Could someone please help me how to modify below query to be able to list all the spaces with (ONLY) last page that is modified? at the moment the below query list all pages in all spaces with the date they each modified. I want to be able to see the only last page that is been modified.
Confluence server env not cloud and please note macros, plugins etc etc is not an option.
query:
SELECT s.spacekey,
c.title,
u.username AS Creator,
c.creationdate,
um.username AS LastModifier,
c.lastmoddate
FROM content c
JOIN spaces s ON c.spaceid = s.spaceid
JOIN user_mapping u ON c.creator = u.user_key
JOIN user_mapping um ON c.lastmodifier = um.user_key
WHERE c.prevver IS NULL
AND c.contenttype = 'PAGE'
AND c.content_status = 'current'
Order BY spacekey,title;
Thank you
I worked it out and thought to share my findings in case someone else stuck. hope this helps
SELECT s.spacekey,
c.title,
u.username AS Creator,
c.creationdate,
um.username AS LastModifier,
c.lastmoddate
FROM content c
JOIN spaces s ON c.spaceid = s.spaceid
JOIN user_mapping u ON c.creator = u.user_key
JOIN user_mapping um ON c.lastmodifier = um.user_key
WHERE c.prevver IS NULL
AND c.lastmoddate = (select max(c.lastmoddate) from content c where c.spaceid = s.spaceid and c.contenttype = 'PAGE' and c.content_status = 'current')
Order BY spacekey,title;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.