Set duration field value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 04:53 AM - edited ‎12-23-2022 04:59 AM
Hi Folks ,
I am adding two durations and then trying to set the duration field value with that ....but the duration is not getting set correctly . I am getting the correct value after adding but while setting it is not correct . It is calculating from 1970 I guess. How can I get the correct duration value and set it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 05:14 AM
Hi @Tapish Sharma1 ,
Please share your script.
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 05:36 AM
if(sla.next()){{ //sla is the task_sla gliderecord object
var pauseDuration = new GlideDuration(sla.pause_duration.getDisplayValue());
var test = new GlideDuration(duration2);
var ans = pauseDuration.add(test);
sla.setValue('pause_duration',ans);
}