Any advice on using duration field for closed problem tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 12:28 PM
Help - trying to use the Duration field on Closed Problem Tasks.
Created to Closed, but nothing is showing in the Duration field.
What am I missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 02:26 PM
Duration is a field whcih is on the task table and here are a few details
https://www.servicenow.com/community/csm-forum/catalog-task-duration-business-rule/m-p/403227
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 11:52 PM
Hello @JohnEJasinski ,
Using the Duration and especially the Business Duration fields is no longer recommended, as SLAs provide a better alternative that gives more control over the schedules and time zones involved in the calculation.
If you want to go ahead with using the duration fields you can create a Business Rule as shown below:
Advanced Script:
(function executeRule(current, previous /*null when async*/ ) {
current.business_duration = gs.calDateDiff(current.opened_at.getDisplayValue(), current.closed_at.getDisplayValue(), false);
current.calendar_duration = gs.dateDiff(current.opened_at.getDisplayValue(), current.closed_at.getDisplayValue(), false);
})(current, previous);
Regards,
Robert