In the given scenario it should give the group of category and give avg resolution time for category

Kongaleti Navee
Tera Contributor

Usecase: Calculate the average resolution time for incidents in a specific category.

Description: Implement a Script Include that calculates the average resolution time for incidents in a particular category based on their start and end time fields.

 

4 REPLIES 4

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
Where you need this average?
You can create it using performance analytics.

 

 

 


Thanks and Regards,

Saurabh Gupta

Kongaleti Navee
Tera Contributor

i want to show it in the background script what was the resolution that each category is taking like for example given  below as it show on the background script.

 

var CalculateDuration = Class.create();
CalculateDuration.prototype = {
    initialize: function() {},

    type: 'CalculateDuration',
   calculateDurationDate:function(dateof){
gs.info('newdate of'+dateof.sys_created_on)
gs.info('olddate of'+dateof.u_duration)
gs.info('olddate of'+gs.dateDiff(dateof.sys_created_on,dateof.u_duration,true))
 
   }
};
background script
var gr = new GlideRecord('incident');
gr.addQuery('sys_id','471bfbc7a9fe198101e77a3e10e5d47f');
gr.query();
if(gr.next()){
    gs.info(gr.number)
    new CalculateDuration().calculateDurationDate(gr);
}
 
result:-
*** Script: INC0000039
*** Script: newdate of2023-07-12 00:42:29
*** Script: olddate of
*** Script: olddate ofnull

AndersBGS
Tera Patron
Tera Patron

Hi @Kongaleti Navee ,

 

It doesn't make any sense to create a script include to calculate the average resolution time for a specific category. You instead will utilize performance analytics to calculate the requested calculation.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Kongaleti Navee 

 

Look like you are putting your requirement to the community to provide you a readymade solution.  Please share what you tried

 

- Did you try with reporting

- Give a try on PA as this require calculations.

 

Give a try buddy, and share the feedback, we all are to guide you, support 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]

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