This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 0;
var cur = new GlideRecord('sys_audit_delete');
cur.setWorkflow(false);
cur.addEncodedQuery('tablename=change_task^sys_created_onONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)');
cur.query();
while(cur.next()){
count ++;
var und = new GlideAuditDelete().get(cur.documentkey);
und.insert();
cur.deleteRecord();
}
gs.print(count);
Wednesday, October 30, 2013
Mass un-delete
Well I finally did it. Yes that's right I managed to write a business rule that was so well tested that it deleted all 12000 change tasks in our system. Whoops! Not too big of a deal right?! Thankfully I caught it pretty quickly and managed to run the below script which set everything straight. It was a bit too cumbersome to undelete them 100 at a time from the list view.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment