i have created one archive rule on incident table to archive the closed incident by 4 years ago and when we update the filter conditions & click on the run archive now no records getting archived?

Susilpa
Kilo Expert

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

1 ACCEPTED SOLUTION

Susilpa
Kilo Expert

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

View solution in original post

4 REPLIES 4

Musab Rasheed
Tera Sage
Tera Sage

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

Please hit like and mark my response as correct if that helps
Regards,
Musab

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

Susilpa
Kilo Expert

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

Hi, 

I tried this, still my archive is not running. Any idea on what could be the issue?