Incident report for resolved tickets within 10 Days

Keerti2
Mega Expert

Need a urgent help to pull report for incidents   resolved within 10 Days from creation of incident , another report is for for after 10 days resolved from creation of incident.

Can any one help me either script include or any other code?

5 REPLIES 5

Satyanarayana C
ServiceNow Employee
ServiceNow Employee

Hi,

Please use below code to get the days between creation of incident and resolving the incident.

function getNumberOfDays(opened_at, resolved_at) {

var date1 = new GlideDateTime(opened_at); 
var date2 = new GlideDateTime(resolved_at);

var diffSeconds = gs.dateDiff(date1.getDisplayValue(), date2.getDisplayValue(), true);


return (diffSeconds/86400);


}

Thanks

Ajaykumar1
Tera Guru

Hi Keerti,

Please follow below steps to create report on the incidents resolved within 10 days after creation:

Navigate to Reports > Create New > Provide a suitable name to the Report (Incident Resolved within 10 days) > Select "Table" in Source type field > Select "Incident Metric" in Table field > Click Next and select the appropriate chart/bar diagram

Now in Filter conditions you have to select > Business Resolve time | Less than | 10> AND > Definition | is | Create to Resolve Duration

Refer Screenshot:

find_real_file.png

 

Mark If you found this Correct/Helpful.

Regards,
Ajay 

 

 

Keerti2
Mega Expert

Kindly let me know if this works for sc_request or sc_req_item or sc_task table  also ?

gyedwab
Mega Guru

A codeless way where you can do this against Incident or any other Table using Explore Analytics:

find_real_file.png

find_real_file.png

Or, you could use the binning feature to "group by" spans of duration:

find_real_file.png

find_real_file.png