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,365,244
Community Members
 
Community Events
168
Community Groups

How to delete the history version of the attachment in the plugin

How to delete the history version of the attachment in the plugin?

I've written a confluence plugin and want to delete the historical versions of space attachments to clean up disk space。

I initially tried to use the attachmentManager.removeAttachmentVersionFromServer(att) method to remove attachments, but only the most open attachments were removed per run, after which the error occurred:

Exception in thread "Thread-85" org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.atlassian.confluence.pages.Attachment#884751]

I later saw CachingAttachmentManager and tried to use that method. But I somehow imported into the plugin. The constructor of CachingAttachmentManager contains parameters.

image.png

Can someone tell me how to delete the historical version of the attachment in the plugin?
Or tell me how to introduce that CachingAttachmentManager?

 

Thank you everyone

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events