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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
4,554,749
Community Members
 
Community Events
184
Community Groups

List all spaces and spacekey and page last modified - ONLY last page modified

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

1 answer

1 accepted

0 votes
Answer accepted

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;

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events