- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2017 03:18 AM
tickets which are not updated in LAst 5 days - this reports i used to fetch via Updated RElative 5 days filter. but later due to some business requirements i implemented a Schedule job which runs daily ad updates every ticket's DURATION field [current date - Created Date], but due to this every ticket is technically updated on daily basis
we want to see the ticket which were not updated [means Commented in Customer or Work Notes section]. can you help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2017 05:49 AM
use this
var nonInc = new GlideRecord('task');
nonInc.addEncodedQuery('active=true^sys_class_name!=incident');
nonInc.autoSysFields(false);
nonInc.query();
//gs.log("Found " + nonInc.getRowCount() + " records");
while(nonInc.next()){
var now = gs.nowDateTime();
var opened = nonInc.opened_at.getDisplayValue();
var calDur = gs.dateDiff(opened, now, false);
nonInc.calendar_duration = calDur;
nonInc.update();
}
var inc = new GlideRecord('incident');
inc.addEncodedQuery('active=true^state!=6');
inc.autoSysFields(false);
inc.query();
//gs.log("Found " + inc.getRowCount() + " incident records");
while(inc.next()){
var now = gs.nowDateTime();
var opened = inc.opened_at.getDisplayValue();
var calDur = gs.dateDiff(opened, now, false);
inc.calendar_duration = calDur;
inc.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2017 05:49 AM
use this
var nonInc = new GlideRecord('task');
nonInc.addEncodedQuery('active=true^sys_class_name!=incident');
nonInc.autoSysFields(false);
nonInc.query();
//gs.log("Found " + nonInc.getRowCount() + " records");
while(nonInc.next()){
var now = gs.nowDateTime();
var opened = nonInc.opened_at.getDisplayValue();
var calDur = gs.dateDiff(opened, now, false);
nonInc.calendar_duration = calDur;
nonInc.update();
}
var inc = new GlideRecord('incident');
inc.addEncodedQuery('active=true^state!=6');
inc.autoSysFields(false);
inc.query();
//gs.log("Found " + inc.getRowCount() + " incident records");
while(inc.next()){
var now = gs.nowDateTime();
var opened = inc.opened_at.getDisplayValue();
var calDur = gs.dateDiff(opened, now, false);
inc.calendar_duration = calDur;
inc.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2017 11:54 PM
Thanks Sir t_anurag, this helped alot. now we are able to fetch report on X number of days. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2017 05:53 AM
Thanks for the prompt help, i have just updated the same . the sequence you suggested. will inform you tomorrow what happens Thanks once again