Calculating Business Duration Issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-24-2024 12:10 PM
Hello, we have a business rule that calculates the business duration based on a set schedule (working hours from 06:30 - 18:30 CST). This, for the most part has been working correctly, but I'm noticing some issues if the ticket is created before or after working hours. In this case, the business duration will calculate to 0 seconds and not account for the actual business time. The parent scheduled referenced in the script is on the US/Central timezone as well as our system timezone the same, unsure of why it's unable to calculate some of the business durations properly.
the BR script is an after update when the state moves to closed or cancelled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2024 04:01 AM
You can check the link, It may can help
https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server/no-namespace/c_GlideSche...
Mark this Helpful if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2024 08:04 AM
No this doesn't answer my question of why the script doesn't calculate properly when a ticket is created outside of the schedule time or why I'm getting 0 seconds for some of these calculations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2024 09:14 PM
Have you tried as per documentation i have added and the screenshot for start and end
for this
Please provide that as start and end as per screenshot, put the date time in gsBusiness.duration(new GlideDateTime(gr.opened_at), new GlideDateTime(gr.closed_at))function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2025 07:55 AM
I've already done that if you look at the code I pasted originally.