Insight - How to delete Object History logs
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
Atlassian Support Offerings
The following approaches that involves SQL queries are beyond Atlassian Support Offerings. Please note that Atlassian does not support direct database INSERT, UPDATE or DELETE queries, as they can easily lead to data integrity problems. Atlassian will not be held liable for any errors or other unexpected events resulting from the use of the following SQL queries.
Remove Object's History logs is not possible through Insight UI. This is how to perform this action using Database queries.
This has been recorded as an improvement area for Insight:
Until the product improvement is in place this Article intends to describe a way of removing Object's History records.
Insight asset management
Before you begin
Alwaysyour data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Table AO_8542F1_IFJ_OBJ_HIST is where all the History values are stored for existing Objects. To verify all of the affected entries, and the database structure for further tweaks, run a select query against the object that you're looking to remove history from:
SELECT * FROM "AO_8542F1_IFJ_OBJ_HIST" WHERE "OBJECT_ID" = XXX;
To remove the history logs, we have 2 options, one to remove by date older than, or by specifying an object ID:
DELETE FROM "AO_8542F1_IFJ_OBJ_HIST" WHERE "CREATED" < '2020-12-31 00:00:00.0';
DELETE FROM "AO_8542F1_IFJ_OBJ_HIST" WHERE "OBJECT_ID" = XXX;
The Object ID is the numeric part of the Object Key, and will also show in the Object URL when you navigate to the Object
This is tested on PostgreSQL and may need modifying for other DBMS such as Oracle or SQL Server.
Deleting History entries will only remove the History records from the Object, no other part/functionality in Insight should be affected by removing the Object's History