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

Automation Rule: Delete Page Versions

Amy Carey
Contributor
September 3, 2024

Is it possible to set up an automation rule to remove/delete page versions after a certain limit such as page versions above 10? If so, please provide guidance on how to write the rule. Thank you.

Update 9/9/2024: It is mentioned in Atlassian documentation as a best-practice to have retention rules as "Confluence stores the previous content so you can restore it if you need to. Over time these historical versions start to add up, increasing the size of your database and attachments directory.  It's not uncommon for some pages to have hundreds of historical versions, or for a space to have hundreds of items in the trash."

Does this only apply to data center and not cloud? We have Premium which offers unlimited storage but is it a best-practice to manage page versions?

4 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Michiel Schuijer
Contributor
September 10, 2024

I don't think that is possible.

The best app to manage content that I know of and have tested (not purchased) is https://marketplace.atlassian.com/apps/123/better-content-archiving-for-confluence?tab=overview&hosting=cloud

Even that app cannot target versions of pages yet, probably because this is not accessible in the way that you want via the API.

0 votes
Bjørn Anger
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 9, 2024

A solution to this problem would be great!
Deleting older versions after X days/months/years would be a good thing for me. Or when you think of this in the backup-way, deleting everything but leave the last X versions and the last version of every month.

In general this topic is more about hygiene than space.

0 votes
Rick Westbrock
Contributor
September 9, 2024

I am curious about the use cases for deleting a specific version of a page. The only thing I could think of myself was to deal with a user who entered a "secret" value on a page such as a password or API token.

0 votes
Thomas Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2024

Someone please correct me if I am wrong, but it seems this is not possible. Either through standard components in Automation or by calling the rest api in a web request. To my knowledge you may only delete a page using the rest api and not specific versions of a page. Even if retrieving page version data is possible.

Matt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 5, 2024

With the REST API it is possible to delete a specific version, send a DELETE request to the content ID / version ID endpoint: 

/wiki/rest/api/content/<ID>/version/<ID>

Like # people like this
Rick Westbrock
Contributor
September 9, 2024

Interesting that a specific version can be deleted. What happens to the later version numbers: do they remain the same (leaving a "gap" in version numbers) or are they reduced by one?

Matt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2024

@Rick Westbrock, the version numbers will be decreased by 1, no gap will be left, and users would not have any indication that a version had been deleted.

Why would this be done? My only thoughts would be related to information lifecycle management. If an org wants to archive content but also keep the most recent 5 versions, for legal reasons or whatnot, they may make use of this API to delete any older versions, apply a label, and then archive the content. There may be other use cases but that jumps out as a one possibility making use of native Confluence features vs a 3rd party add-on.

 

Edit - Or as you mention, needing to remove a password/passphrase/api key from a page and its history.

Like Rick Westbrock likes this
TAGS
AUG Leaders

Atlassian Community Events