- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 10:43 AM
Hi All,
I have two customized duration fields 1. Time elapsed in duration 2. On hold duration.
Now my requirement is, I need to calculate time difference between above two duration fields and insert the output to another duration filed i.e MTTR.
MTTR= Time elapsed duration minus on hold duration.
Pls note,here all the field types are duration only.
I'm try with below update BR, but not getting desired input. pls help me.
kindly refer below snap as well...
Here my desire output is MTTR= Time elapsed minus on hold duration, then value(MTTR) should be 1 day 1 hour but here value I'm getting as empty.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 09:41 PM
try this
var dura = current.u_time_elapse.dateNumericValue();
var durb = current.u_on_hold_duration.dateNumericValue();
current.u_mttr_of_mi.setDateNumericValue(dura - durb);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2023 12:19 AM
Glad to help.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 05:08 AM
Thanks alot @Ankur Bawiskar - it really helped me as well.