How we can calculate the engineer's productivity

Jyoti Malhotra
Tera Contributor

Hi Team,

 

How we can calculate the engineer's productivity on incident ticket.

 

In below screen shot User ITIL worked from 11:52:43 to 11:58:05. 

 

I want to calculate the all engineers productivity on ticket.

 

JyotiMalhotra_0-1724049472770.png

 

Thanks

JM

1 ACCEPTED SOLUTION

You can just use the OOB 'assigned_to' metric definition. Copy it and set it to your own field.

Do know that it is very vague what you are trying to accomplish. Assigned_to is an OOB field, doing the same as your custom field. I feel you are creating a lot of technical debt on your instance without a good reason.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

32 REPLIES 32

You can just use the OOB 'assigned_to' metric definition. Copy it and set it to your own field.

Do know that it is very vague what you are trying to accomplish. Assigned_to is an OOB field, doing the same as your custom field. I feel you are creating a lot of technical debt on your instance without a good reason.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi @Jyoti Malhotra 

 

Sorry for delay in response. What i shared was OOTB and you can use that without any code. Hope that help you. 

*************************************************************************************************************
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]

****************************************************************************************************************

Hi Atul,

 

I'm trying to create Metric script for below requirement:

 

For example: First Engineer worked on one ticket for 10 minutes and after that Second Engineer worked on same ticket for 5 minutes, now again First Engineer worked for the same ticket for 10 minutes. For First Engineer duration timing should be show as total 20 minutes for that ticket.

Note: Previous work timings should also get added for engineers.

 

Thanks

JM

Hi @Jyoti Malhotra 

No that is not possible, that you need to do manually in excel sheet or when you create the report then group by Assigned TO. 

*************************************************************************************************************
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]

****************************************************************************************************************

Hi Atul,

 

With below Metric script I'm trying to capture the Engineer's start and end time as per ticket assignment and calculate the duration how much time spent by engineer on ticket.

 

if (current.u_ticket_handled_by) {
    createMetric();
}
 
function createMetric() {
    var mi = new MetricInstance(definition, current);
   
    // Get the previous assignment
    var prevAssignment = new GlideRecord('metric_instance');
    prevAssignment.addQuery('value', current.u_ticket_handled_by);
    prevAssignment.addQuery('task', current.sys_id);  // Assuming the task field links to the incident
    prevAssignment.orderByDesc('sys_created_on');
    prevAssignment.setLimit(1);
    prevAssignment.query();
   
    var gr = mi.getNewRecord();
   
   
        gr.start = current.sys_created_on;  // If it's the first assignment, use the ticket creation time
   
   
    gr.end = current.sys_updated_on;  // The time when the ticket was last updated
   
    gr.value = current.u_ticket_handled_by;
   
    // Calculate the duration in HH:MM:SS format
    gr.duration = gs.dateDiff(gr.start.getDisplayValue(), gr.end.getDisplayValue());
 
    gr.calculation_complete = true;
    gr.insert();
}
 
In the below screen shot for User 'USER ITIL' start time it's taking since when the incident created, but i want start time should be come as when ticket acknowledged by the User 'USER ITIL'   and end time should be come as when ticket assigned to next engineer 'USER'.  then for 'USER ITIL' duration should be capture for how much time 'USER ITIL'  worked on this ticket.
JyotiMalhotra_0-1724343934552.png

 

Thanks

JM