Report of all the Incidents that got downgraded from P1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 02:47 AM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 03:06 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 03:11 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 03:55 AM
Hi Rahul,
You can look for History line table (sys_history_line.LIST) from application navigator & use below filters
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 04:04 AM - edited 01-31-2023 04:07 AM
Hi all,
Please create report as per below screenshot, mark this answer useful if this helps.