How to get the deletion date of a trash item?
Asked by ABoerio:

Hi all,

as an admin I want to periodically empty the Confluence space trash, but I'd like to do it (manually or by a Scriptrunner Script) based on how much old are the files in the trash.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/86682i4853C841931FEC6D/image-size/large?v=v2&px=999 "image.png")

In the space trash view I can't see the information I'm looking for (the deletion date)?

It's OK also to get it by a SR script, if there's no other chance, but I guess it's quite curious to not have this information directly from the trash page.

Any hint?

Thanks, Ciao, Andrea


Answers:
author: Diego
body: Hello [@ABoerio](/t5/user/viewprofilepage/user-id/2035799) ! The information which you are looking for is indeed not located within the "trash can" itself. We can access it in the instance Audit Log.

All page deletions are logged there and only an admin can access it. Here is how it looks like when we see the audit log for a page deletion:
> ![Anota??o 2020-03-17 191944.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/86839iBFB90470B6AB4527/image-dimensions/528x147?v=v2 "Anota??o 2020-03-17 191944.jpg")

Here is an excerpt from our audit log page:
> *The audit log allows administrators to look back at changes that have been made in your site. This is useful when you need to troubleshoot a problem or if you need to keep a record of important events, such as changes to global permissions. You'll need Confluence Administrator permissions to view the audit log.*

For more information on the Audit Logs generated by Confluence, you can take a look here:
> * ++**[\[Confluence Server\] Audit log](https://confluence.atlassian.com/doc/audit-log-829076528.html)**++

With this in mind, I can say that whatever method you are looking forward to use, it needs to look into the audit logs and not the trash page itself.

Let us hear from you, Andrea! I hope this helps.

comments: author: ABoerio
body: Hi [@Diego](/t5/user/viewprofilepage/user-id/1188952) , thanks a lot.

This log can actually be very useful.

I just don't understand how to use the filter, to better define queries to view only the lines I need.

Eg I'd like to filter out the Scriptrunner event type lines, then search only the deletion events, etc...

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/86891i566F8AC9EEA81A75/image-size/large?v=v2&px=999 "image.png")

Thanks, Andrea


author: ABoerio
body: [@Diego](/t5/user/viewprofilepage/user-id/1188952) any comments?

I'm trying to deal with this but ... wouldn't it be much easier to have a column with the deletion date in the trash can view?

Wouldn't it be quite simple for you to add it?

Thanks Anyway, Ciao,

Andrea


author: Diego
body: Hello there, [@ABoerio](/t5/user/viewprofilepage/user-id/2035799) ! Thanks for keeping things alive here. I did not receive the notification pointing to your previous comment.

So, let us waste no more time!

I was able to find two Feature Requests that might be interesting for your uses. One of them aims at pinning more detailed information directly into the trashed items in your instance. The other one goes for automatic trash purging from Confluence.

Here, take a look:
> * ++**[Display more details for pages in the trash: "who","when","why","what"](https://jira.atlassian.com/browse/CONFCLOUD-4792)**++
> * ++**[Allow Confluence to auto purge trash over a period of time](https://jira.atlassian.com/browse/CONFCLOUD-18160)**++

Also, after looking into Scriptrunner documentation, I was able to find that the Plugin does have its own Log system.

You can check it here:
> * ++**[\[Adaptavist\] Scriptrunner - Logs](http://scriptrunner-docs.connect.adaptavist.com/confluencecloud/logs.html)**++

Again, thanks for sending a second message my way! I would not have checked the thread if you did not.

O hope this helps!


author: ABoerio
body: OK, there's a feature request, I've seen it now, and I will wait...

How can this be considered not a basic function?

I really can't understand, honestly, but thanks for your time.

Ciao, Andrea


Tags: confluence-server

scriptrunner