Want report on average duration to show in hours

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

I wonder if it is possible to make the vertical line here in hours instead of "days". I have put the attribute "max_unit=hours" on the field so when looking on an incident the task sla show the duration in hours, like 34 hours.

But then I put a report on the vaules, I still get that in "days"...

Like this:

sla hours 2.GIF

I rather have it in ours like: 27hours, 56hours etc...

Hoping that there are a settting or something simular so I don't have to make a own field and the the vaule there in hours and then do the average on that field.

1 ACCEPTED SOLUTION

Yea,



Not with the oob things. I hade to create a own field that I called Business elapsed in hours.



I then in the calculated value put the code to recount the time into hours.


It looks like this:


report hours 2.PNG



Then I use that field instead in the report and get something like this:



report hours.PNG




Hope this will help you. Let me know if you got any other questions or ideas.



//Göran


View solution in original post

14 REPLIES 14

Can't hide it on the form, since the form is using the Incident table. 
Trying to copy the value from Business_Duration (Business Elapsed Time) in the Task_SLA table. 

Can't get business rule to fire. 

Did that but management wants the standards to be in HH:MM:SS. 

ServiceNOW says this is an enhancement or that it might exist in Performance Analytics.

montanadawgz
Mega Contributor

We don't have performance analytics yet but will be getting it in the next 2 years.

Meanwhile management wants all reports to be in HH:MM format. 

Report: Incident Mean Time to Resolution by Service Owner - Last QTR

Type: Bar

Group by Business Service Owner

Stacked by Priority

Aggregation: Average

Aggregation field: Business Elapsed time

Percentages: Use Aggregation

No groups System Default.

Conditions: Resolved on Last Quarter.

Even though I set the max_unit = Hours, the time to HH:MM the aggregation changes it back to DD:HH:MM. 

 

So the solution is to create a customized field call Business Elapsed Hours (BEH), in hours. 

Is it possible to get it to calculate to HH: MM? 

I then question is will the BEH field then show up in the Aggregated field, and be able to calculate the Average?

montanadawgz
Mega Contributor

Service NOW recommends that I write a Business Rule using the Incident Table so that when the Incident State is updated to Acknowledge, the I want the find the Business Elapsed time (business_duration) and copy it into my new customized field u_business_elapsed_hours, which I have for formatting as HH:MM:SS, regardless of if it is used as an Aggregate total.

However I cannot get business rule to work:

When to run:
Incident_state = Acknowledged

(function executeRule(current, previous /*null when async*/) {


var betdur = current.getValue(task_sla.business_duration);
current.setValue(task_sla.u_business_elapsed_hours, betdur);

})(current, previous);

 

If I can get the business_elapsed_hour field to get filled in, then I can repeat this process

for the Incident-state = Resolved.  I might created another BEH field for Resolved, 

and a separate one for BEH Response.

 

Reported a BUG to Service NOW, since the time_max=hours (HH:MM:SS format) only works on list and line reports. Any time an Aggregate report is used, it ignored the time_max value, and defaults back to DD:HH:MM:SS

Daniel50
Kilo Guru

Hi there

Is there any way that the report considers the schedule? I have a report for estimated work duration. Eventhough the schedule ist "5x8 Workingdays" 1 Day counts as 24 hours. Do you know what I mean? It counts for example:

1 Day 8 Hours 30 Minuten +

2 Day 7 Hours 30 Minuten +

3 Day 5 Hours 30 Minuten = 6 Days 20 Hours 30 Minutes

it's supposed to be 8 Days 5 Hours 30 Minutes

I just couldn't figure it out.

Any ideas?

Daniel