two Fileds type are Date/Time and but mttr fields type is duration type then how to calculate mttr
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 03:42 AM
two Fileds type are Date/Time and but mttr fields type is duration type then how to calculate mttr based on created and resolved. i try to do below is the code: but i am getting output in datetime value but i want output value mttr in duration . If anyone know Please assit me on this issue.
var mttr = GlideDateTime.subtract(new GlideDateTime(current.getValue('resolved_at')), new GlideDateTime(current.getValue('sys_created_on')));
var difference = new GlideDuration(mttr);
current.u_rpt_mttr = difference;
gs.log("Resolved date" + current.getValue('resolved_at'));
gs.log("Created date" + current.getValue('sys_created_on'));
gs.log("Mttr Timing" + current.u_rpt_mttr);
current.update();
0 REPLIES 0