OLA not triggered

Bh2
Tera Contributor

Hi Help,

 

Good day. I have a requirement to get a list of incidents for which the OLAs (both response or resolution) are not triggered. How to achieve this. On which table should I query. 

If it is the incident table, how should I query?

 

Thanks in Advance

5 REPLIES 5

hello @Bh2 ,

you can create a normal report on incident table and type as bar graph and call a script include like below to get the incident sys_ids

Screenshot 2023-08-14 at 12.58.53.png

 

Script include:

var getSlaIncidents = Class.create();
getSlaIncidents.prototype = {
initialize: function() {
},
getincidents:function()
{
	var arr=[];
var gr = new GlideRecord('incident');
gr.addActiveQuery();
gr.query();
while(gr.next())
{

		var no_sla = new GlideRecord('task_sla');
		no_sla.addQuery('task',gr.sys_id);
	        no_sla.query();
		if(!no_sla.next())
		{
		arr.push(gr.sys_id.toString());
		}
}
return  "sys_idIN"+arr.toString();
},

type: 'getSlaIncidents'
};

 

SCRIPT INCLUDE NAME: getSlaIncidents

 

Hope this helps 

Mark my answer correct if this helps you 

Thanks