- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2024 03:27 AM
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
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 06:20 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2024 10:09 AM
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.
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 05:20 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 06:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 09:22 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2024 01:56 AM
Happy to help 🙂