How to store the business hours since the incident was last updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 02:46 AM
Hi All,
I want to store the business hours in some field since the incident was last updated.
For example if incident was last updated 2 days ago, I want to add that time in business hours & store it in some field.
So, here the field will store the value as (9x2 = 18 hours) .
Any help will be appreciated.
Thanks
Nayan Mule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 07:34 AM
please share what script did you try and what didn't work
what debugging have you done from your side?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 07:55 AM
Hi @Ankur Bawiskar ,
I have used the same code you have given, but business hours is not getting calculated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 08:00 AM
what debugging have you done so far and what's your analysis?
Recently I shared solution for something similar, check that
calculate Duration and Business Duration in scoped application
also check these links
subtract time from schedule to update task due date
Calculate Date By Adding or Subtracting Time With A Schedule
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
01-21-2025 07:43 PM
Hope you are doing good.
Did my reply answer your question?
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
01-21-2025 10:00 PM