How to set Business Duration field on RITM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 05:49 AM
I'm not able to set business duration field on old ritms and i have used below codes.
var grRITM = new GlideRecord('sc_req_item');
grRITM.addEncodedQuery("number=RITM18884753^business_duration=javascript:gs.getDurationDate('0 0:0:0')");
grRITM.query();
if (grRITM.next()) {
var opened = grRITM.opened_at.getValue();
var closed = grRITM.closed_at.getValue();
if (grRITM.business_duration == '') {
grRITM.business_duration = gs.calDateDiff(opened, closed, false);
grRITM.update();
}
}
Is there any alternative method for calDateDiff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 07:43 AM
what was the case raised for?
the BR on incident is OOB and it works, so it should work the same for RITM table
what did ServiceNow say about that case?
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
‎03-28-2025 01:17 PM
Hello @damodharan1
Please confirm if you checked my answer. Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for my efforts and also it can move from unsolved bucket to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeE