This widget could not be displayed.
This widget could not be displayed.

Archived data deletion policy

vandna
Tera Guru

Hello Everyone,

 

We wanted to delete the Archived records of Request, RITM and related records on basis of some configurations, which are stored in different table. For example: we have one table where we have different delete duration for different item.

 

Now the problem is we cannot use OOTB destroy rule because it doesn't have any condition fields and also, we cannot use table cleaner, because even if we delete the archived Request, RITM we could not delete the references like archived variables, audit, etc because archived table doesn't have references.

 

We have some custom solutions to achieve this requirement but I have following questions.

1. Has anyone implemented something like this before?

2. Is there any best possible way to achieve this requirement?

@Chuck Tomasi 

Thank you in advance!!

5 REPLIES 5

Rupesh11
Tera Contributor

Hi Vandna,

 

Please find the solution below for your requirement. You will need to write a script to destroy the archived request data.

 

  1. Script Include / Background Script:

    • You can write either a Script Include or a Background Script to perform the necessary actions.
  2. Query the "sys_archive_log" Table:

    • Query the "sys_archive_log" table and check for the table name "sc_request". You will find archive records for "sc_request" in this table.
  3. Reference Field "ID":

    • In the "sys_archive_log" table, there is a reference field called "ID" which will give you the request number. You can use dot-walking to find the request item name from this reference field as below screen short
    • Rupesh11_0-1717039472468.png

       

  4. Query the "ar_sc_request" Table:

    • Once you have the request item name, you can query the "ar_sc_request" table. Here, you can loop and find-out those request number , and you can destroy the record based on the "created on" or "closed on" fields.
    • Rupesh11_1-1717039550225.png

       

If you need further assistance or have any questions, please let me know.