System Archiving: Issues with archiving attachment

ojhagargi
Tera Contributor

Hello All,

I am using System Archiving to archive the Catalog Task records.

Steps followed:

1) Created an Archiving Rule , with table as "Catalog Task(sc_task)" and condition to archive all inactive records.

2) Under the Archive Related Records, I used "Archive" option in Archive Map   and selected "Table Sys ID in Attachment(sys_attachement)" as Reference.

3) I save the rule and executed the same.

Results:

I could see all the inactive catalog Task being archived in Archive Catalog Task table.

Issues:

1) I was unable to find the attachment attached to the Catalog Task in th archive table What sould i do to veiw the attachement in the archive catalog task.

find_real_file.png

2) I am not getting the option to select "sys_attachment" table in the archive rule., no rule is available on the sys_attachement table.

Please help

Regards,

Gargi Ojha

7 REPLIES 7

Mwatkins
ServiceNow Employee
ServiceNow Employee

Hi Gargi,


The records are actually being archived successfully, you just can't see them through the attachment bar of the related record, like in the normal UI.


So, to see the records, you have to navigate to the table (ar_sys_attachment) directly (see Examples of navigating by URL ).



Also, when restoring the records, you need to restore both the target record (e.g. sc_task, problem, incident...) and the attachments for that record. Here is how:


  1. Set up the Archive Related Record Rule like you did and make sure that Reference Table Rule matches your Archive Rule.
  2. Run the Archive and look at the Archive Run related list
  3. You will see two separate files one for the ar_sc_task and one for the ar_sys_attachment table.
  4. If you open the ar_sc_task records you will not see the attachments listed at the top like you do in the normal UI. You have to open the ar_sys_attachment record directly to see it.
  5. If you restore the ar_sc_task record, the related archive record will NOT be restored automatically, and therefore will also not show up in the UI
  6. However, if you go to the Archive Run related list and restore the relevant ar_sys_attachment record then everything will show up in the UI as expected

Screenshot 2017-06-23 17.15.12.png


Matthew,


Do archive rules used as "Reference Table Rules" need to be active? Do they need to have a parent?


Mwatkins
ServiceNow Employee
ServiceNow Employee

Hey Robert,


I re-read this thread and my previous post was a little confusing, so I re-wrote it for clarity. Please read my post again to see if it is more clear now.


Regards, Matthew


Thanks Matt,


When i try to activate the rule being uses as the "Reference Table Rule" I get a error that it needs to have a condition. Since it's only archiving the referenced records to the parent what condition is needed? To get around the validation I set their condition to "State is anything". If a rule has a parent will it only run on the parent records being archived and not on it's own based on the condition?