Archive Rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2022 02:11 AM
Hi,
Good Day!!
We need to run an Archive rules using scheduled jobs. And, already we have one scheduled item with the name "Archive".
Script is already there in that scheduled item,
new GlideArchiver().archive();
By using this script, all the archive rules are running which are in Active.
But, here we need to run only "Incident" and "Request" Archive rules. those 2 archive rules are also already there in the system. Which is OOB. we need to archive the records, which are closed over 4 years ago.
We have tried incident rule with one script
var gr = new GlideRecord('incident');
gr.query();
while(gr.next())
{
new GlideArchiver().archive(gr);
}
But, it is not archiving any records. Any one can help me with this?
With Regards,
Anitha P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2022 02:17 AM
Hi
there is no reason to script anything as you can configure all rules with no code. See https://docs.servicenow.com/en-US/bundle/sandiego-platform-administration/page/administer/database-r...
And ServiceNow cares about the rest.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 03:45 AM
@Maike , Is there any way to trigger archive rule in scoped application.
Regards,
Lithesh.B