The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Report of all the Incidents that got downgraded from P1.

rahul0602
Kilo Contributor

Hi All

 

I need to create a report that gives the list of all those Incidents that got downgraded from P1.

 

Can anyone help me with this

4 REPLIES 4

Khozema Attar1
Tera Guru

Hello Rahul,

 

We achieve this using an audit table on incident, which stores old Values and new Values for fields on an incident form; whenever a field on incident changes.

 

Fetching report on incident audit table can give you an idea of how many incidents were downgraded from P1.

 

It is a custom table and not OOB.

 

Regards,

Khozema

SagarTajane
Kilo Expert

Hello ,

 

Please try this in Background script.

 

 

var incList =new GlideRecord('sys_history_line')
incList.addEncodedQuery('oldSTARTSWITH1 - High');
incList.query();

while(incList.next())
{

gs.print('Incident Number----->' +incList.getDisplayValue('set'));

}

 

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks
Sagar Tajane

Jaspal Singh
Mega Patron
Mega Patron

Hi Rahul,

 

You can look for History line table (sys_history_line.LIST) from application navigator & use below filters

find_real_file.png

 

This though would require each record to be opened to check for its associated incident.

 

Alternatively, you can use the background script as suggested by Sagar with below snippet.

var count=0;
var incList =new GlideRecord('sys_history_line')
incList.addEncodedQuery('set.tableSTARTSWITHincident^old=1 - Critical^labelSTARTSWITHpriority'); //1 - Critical is value for incident of P1 priority
incList.query();

while(incList.next())
{
gs.print('Incident Number :' +incList.getDisplayValue('set'));
count++;
}
gs.print('A total of :'+count+' incidents has P1 priority downgraded');

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

 

 

Eddie5
Tera Contributor

Hi all,

 

Please create report as per below screenshot, mark this answer useful if this helps.

Eddie5_0-1675166807805.png