- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 11:30 PM
Hi Team,
Good Day.
I have created one archive rule on incident table to archive the 4 years ago closed incidents.
For testing purpose i have gave the filter conditions as active false & closed at some past date time and then saved the rule & activated then clicked on the run archive now ui action from the rule but its not getting archiving the incident records from the incident table and no record getting added into "Archive Run" related list on the archive rule .
Note: Data archiving plugin also installed.
Any help would be appreciated in advance.
Regards,
Kotaiah Sadari
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 08:17 AM
Hi Team,
I have finally figured the issue what is preventing my archive rules not getting to run.
I have seen hug number of archive jobs are in waiting state to run in Archive Job Execution Chunk (sys_archive_run_chunk) table which are causing to prevented other archive rules to run.
I have cancelled those long waiting records by using the following background script and the when i click on "Run Archive Now" form the archive rule now the matched records getting archived.
var chunckgr = new GlideRecord('sys_archive_run_chunk');
chunckgr.addEncodedQuery('rule_id=sys id of the archive run we need to use^state=waiting');
chunckgr.query();
while(chunckgr.next()){
chunckgr.state = 'cancelled';
chunckgr.update();
}
Regards,
Kotaiah Sadari

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 11:35 PM
Hello,
Go through below and see if you are doing something wrong
https://docs.servicenow.com/en-US/bundle/sandiego-platform-administration/page/administer/database-rotation/task/t_CreateAnArchiveRule.html
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0782323
https://www.youtube.com/watch?v=PdAdjG1b6wY
https://www.youtube.com/watch?v=u_Hk3vTCc1c
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 01:38 AM
Thanks for the response musab rasheed.
I have already gone through the links shared by you.
Even one of the archive rule is inactivated its still archiving the records i'm suspecting that archive rule causing the issue.
Many i know how can we prevent that rule being executed.
Regards,
Kotaiah Sadari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 08:17 AM
Hi Team,
I have finally figured the issue what is preventing my archive rules not getting to run.
I have seen hug number of archive jobs are in waiting state to run in Archive Job Execution Chunk (sys_archive_run_chunk) table which are causing to prevented other archive rules to run.
I have cancelled those long waiting records by using the following background script and the when i click on "Run Archive Now" form the archive rule now the matched records getting archived.
var chunckgr = new GlideRecord('sys_archive_run_chunk');
chunckgr.addEncodedQuery('rule_id=sys id of the archive run we need to use^state=waiting');
chunckgr.query();
while(chunckgr.next()){
chunckgr.state = 'cancelled';
chunckgr.update();
}
Regards,
Kotaiah Sadari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2025 04:02 AM
Hi,
I tried this, still my archive is not running. Any idea on what could be the issue?