Business Duration & time worked for HR case

VShine
Mega Guru

Hello Experts,

I have requirement to create  report on total time worked on HR case (once assigned to HR agent) and total time it takes for HR agent to assigned to themselves once Assignment group is change.

We don't have Performance Analytics. Can someone help how to achieve this?

We do have SLA defined for different HR services table. Currently, Business duration & time work is blank for all HR cases. Duration is populated once case is closed.

1 ACCEPTED SOLUTION

By creating Open Metrics for HR case, instances are getting close. Thanks

View solution in original post

11 REPLIES 11

Matthew Swarts
Tera Guru

Hello vikrami,

You will need to make use of Metric Definitions and Metric Instances in order to get these values.  OOTB there are quite a few good examples for Incidents that will allow you to see how to set these up.

Also, once the Metric Definitions are in place and you start capturing these duration values, you will need to report off of them.  The easiest way to achieve this is by creating a Database View.  Again, OOTB there is a good example of how this is done for Incident by looking at the Incident Metric database view.  Below is a screenshot of one I recently have done for Legal Requests.

find_real_file.png

 

On Metric Instances, you can also populate the Business Duration field but it requires a Business rule like below on the Metric Instance table.

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

    var gsBusiness = new GlideSchedule('090eecae0a0a0b260077e1dfa71da828');//8-5 Excluding Holidays Schedule sys_id
    // Get duration based on schedule
    current.business_duration = gsBusiness.duration(current.start.getGlideObject(), current.end.getGlideObject());

})(current, previous);

 

 

Thank you, I will give it a try.

I have created Metric definition for Assigned to for HR case, 

find_real_file.png

Trying to create Database view

find_real_file.png

 

When click on "Try it"., getting 0 records

find_real_file.png

Also, I haven't choose all these fields (Approval, Activity due etc). These are the fields I selected

For HR Case:

find_real_file.png

find_real_file.png

What I am doing wrong?