Calculate resolution time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 08:10 AM
Hello All,
I have created a new field called "resolution time" it should show duration on following bases until the ticket gets resolved. Monday to Friday (from 9am to 6pm). Saturdays, Sunday should be excluded. should also not count the time when the ticket is in state Pending, Pending Caller, Pending Effective date.This is in order to check how much time did assignee took to resolve a ticket
Please provide some ideas how to achieve it. I have BR in mind but not sure how to calculate all these scenarios.
Your help will be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 08:32 AM - edited 12-30-2024 08:34 AM
Hi @SM123 ,
I believe, you must have some SAL configured on that table record, and SLA is already calculating the actula and business duration.
You can copy the business elapsed time to resolution time field via BR when record is set to resolved.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 08:37 AM
Hi @AshishKM ,
Our SLA only calculates 24*5 mon-fri (all day) but i need 9am-6pm. our sla will only pause for pending caller state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 10:40 AM
Ok got it, then you need new schedule definitaion, as suggested by @Runjay Patel and calculate the time.
Or if possible, create new SLA for this requirement.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 08:41 AM
Hi @SM123 ,
You need to create one schedule in which you need to exclude the weekends and set the time of business days and use sys ID of schedule in below code.
var dc = new DurationCalculator();
dc.setSchedule('<sys ID of schedule>');
var diff = dc.calcScheduleDuration(current.sys_created_on, current.resolved_at) ;
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------