- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2016 11:47 AM
Hi Everyone,
Is there any way to display the Business Elapsed Time in Hours only, as an example:
Instead of: 2 Days 3 Hours 14 Minutes
It would show this instead: 51 Hours 14 Minutes
I just think that the way it is displayed at the moment is far too misleading and trying to explain it to every user that asks is a struggle and they never fully understand.
If an SLA Duration is 4 Days and the Schedule is 08:00 - 18:00 then I see it like this:
Day 1: 10 Hours
Day 2: 10 Hours
Day 3: 10 Hours
Day 4: 10 Hours
That's 40 Hours, but is displayed as 1 Day 16 Hours - But has actually been running for 4 Business Days - when users see 1 Day 16 Hours, it just completely confuses them. Either displaying as 4 Business Days or 40 Hours is much more user friendly and I personally think SLA's & Schedules is something that ServiceNow really needs to work on.
Any help/advice would be greatly appreciated.
Many Thanks
Harry
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2016 12:59 PM
After a lot of searching I have found this which does exactly what I wanted:
All I had to do was configure the dictionary entry for the Business Elapsed Time field & add max_unit=hours to the attributes.
Now this field only displays in Hours/Minutes/Seconds.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2016 11:54 AM
Harry,
You can use gs.dateDiff() and get your time difference in seconds and then convert it to hours. Can you paste your code which is generating this elapsed time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2016 12:07 PM
Hi Abhinay,
I'm not really sure where to find the script that generates this, it is a duration field on the Task SLA table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2016 12:24 PM
Harry,
You can use dateNumericValue() to convert it into milliseconds and then divide the result by 3600000 to get number of hours
Here is the usage of it. "current" is my GlideRecord
current.duration.dateNumericValue()/3600000;
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2016 12:45 PM
This doesn't seem to be working, whereabouts did you set that?