Check the last time a space was modified?

Victor Prasad October 4, 2018

Hello,

 

We have way too many abandoned spaces.  Is there any way I can see which spaces have not been modified in a year?

 

We do have ScriptRunner installed.  It has an option for all last modied pages.  Anyway to do this for a space?

 

Thanks,

 

Mr. V

1 answer

2 votes
AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 7, 2018

Hello, Victor.

The easiest way to determine the last modified date for spaces is to query it from the database itself. For example:

SELECT spacename, spacekey, lastmoddate FROM spaces;

There might be better ways of obtaining these kind of information as well through third-party add-on, for example Reporting for Confluence.

Victor Prasad October 9, 2018

Thank you VERY much.

I filtered it further using the SPACETYPE (global vs personal)

 

Trying to get people to clean up their spaces...herding cats.

Like lisa_jackson likes this
AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2018

Hi, Victor.

You are most welcome. Thanks for sharing your solution as well. Ultimately, you used the following SQL query to pull the information from the database:

SELECT spacename, spacekey, spacetype, lastmoddate FROM spaces;

I can only imagine when the instance gets bigger and unmanageable. So, it's good to perform some housekeeping to keep it at its optimum level.

Victor Prasad October 10, 2018

Hi Ahmad,

Have any strategies for keeping those abandoned sites to a minimum?

Besides begging?

Thanks,

V

AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2018

Hello, Victor.

If the space is really not needed anymore, it will be best to reach out to the owners and ask them to properly delete them. You can bulk delete spaces but a third-party addon is needed - Is it possible to bulk delete Spaces in Confluence.

If there might come a time when the space and its contents needs to be reviewed again, you can consider archiving the space and it won't appear in the instance unless searched.

If the space could still be useful, keep it and ask the owners to update it with the necessary content (pages / blog post / meeting notes).

Victor Prasad October 11, 2018

The issue here is most space owners just leave their spaces or leave the organization and we have all these orphaned spaces.

 

I have found a problem with the script.  While it returns a data (last modified) it is not what appears on the page.

For example the script is showing a date of 2010-04-12 but when I go to the space homepage it shows 2018-08-23...this year last modified by...

So what exactly is this date showing me?  A page?  Which page?

Any ideas?

 

Thanks for your ongoing support!

AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2018

Hello, Victor.

My sincere apologies as I was looking at the wrong information. I double checked on my end and verified that the table that we should also be looking at is actually the content table as well.

SELECT spaces.spacename, MAX(content.lastmoddate) FROM content, spaces WHERE content.spaceid = spaces.spaceid GROUP BY spaces.spacename; 

Please try running the query above which should identify the last date on which content was modified in each space within a single Confluence instance. Let me know how it goes on your end.

Like # people like this
Victor Prasad October 12, 2018

no need to apologize - you are helping me!!!!!

I am using this:

SELECT SPACES.SPACENAME, MAX(CONTENT.LASTMODDATE)
FROM CONTENT, SPACES
WHERE CONTENT.SPACEID = SPACES.SPACEID AND SPACES.SPACETYPE like 'global'
GROUP BY SPACES.SPACENAME;

 

and I see results - need to go validate a few - but I think we are good!

Like # people like this
AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 14, 2018

Hi, Victor.

You are always welcome. Good catch on the additional parameters in the SQL query:

AND SPACES.SPACETYPE like 'global'

Always happy to help!

Like Fleur Post likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events