Incident FCR report to filter out cases OnHold/Pending

vivek72
Tera Guru

Hi,

 

I am building a FCR report for which below are the requirements :

 

1. Incidents which were put on hold anytime during Incident lifecycle from New to Closed, must be excluded from the report.

2. Incidents created and resolved on same group should be added to report.

 

Point 2 can be achieved from reassignment count but I am not sure on how to achieve point 1.

 

Please suggest if anyone has done this before.

 

Thanks,

Vivek

1 ACCEPTED SOLUTION

You'd run the code in a background script to amend the filter condition as the UI doesn't allow you to do it (but the functionality is supported)

I've attached the data source record too

View solution in original post

9 REPLIES 9

So it doesn't look like report builder will let you directly set the related query on the metric instance table - likely because of the m2m nature and joining on a document_id field. However if you're comfortable following the below, it's a workable solution.

 

Create a new report data source by going to "Report Sources" application menu or to sys_report_source table.

KieranAnson_0-1714582792303.png

The above covers the 2nd requirement, but we need to add the 1st.

 

If you have SN-Utils installed (highly recommend the plugin) you can double-click the 'filter' label to amend the filter query to the following

 

reassignment_count=0^state=7^active=false^RLQUERYmetric_instance.id,=0^definition=35f2b283c0a808ae000b7132cd0a4f55^value=On Hold^ENDRLQUERY

KieranAnson_1-1714583255178.png

 

If you don't, you can edit the filter query via a script

var metricGr = new GlideRecord('sys_report_source');
if(metricGr.get('27bd4e1f83b182105e43c4a6feaad399')){ //Replace with sys_id of report source created
	metricGr.setValue('filter' , 'reassignment_count=0^state=7^active=false^RLQUERYmetric_instance.id,=0^definition=35f2b283c0a808ae000b7132cd0a4f55^value=On Hold^ENDRLQUERY');
	metricGr.update()
}

 

Your users can then use this in report builder

KieranAnson_2-1714583375402.png

 

Hi @Kieran Anson ,

This looks like a perfect solution. !!

 

I created a new report source as per your first screen shot but I am unable to select metrics table in related list conditions and also couldn't select definition and value as per your second screen shot .

 

Please guide what table I should select in related list conditions, as I don't have SN Utils, I didn't find where should I put the code for editing filter query to get metric table in related list table.

 

Looks like I am missing something basic here, sorry about that.

You'd run the code in a background script to amend the filter condition as the UI doesn't allow you to do it (but the functionality is supported)

I've attached the data source record too

Thank you so much @Kieran Anson .

Now I got it 🙂

Really appreciate for giving time to explain it in detail and to help me out here with such an amazing concept which I have never even heard before.

Happy to help 🙂