I am trying to build some search queries that will pull Incidents/Service Requests that would be missing certain relationships. Specifically, we want to find
1) Incidents where we have not attached a KA
2) First Call Resolve Incidents where there have been no Journal - Notes created
I don't see those relationships available in the Search Manager builder. Outside of building a counter, is there an option in the Business Object Properties that I can set? Haven't seen that yet.
Hit the dropdown next to 'New' in the search builder;
You're looking for a Related clause, there should be an option where 'There are no' items in the relationship where certain criteria are true
If you want to explicitly search based on incidents where X where related records do/do not exist, the normal comparison search (the default) is not the correct option.
You can combine a search using comparisons (e.g. incident.status is closed) with a Related Clause:
Unfortunately, I do not know of a way to also apply a filter to the related clause query, so this would search for ANY journal. You would need to define a new relationship limited to Journal-Notes to use this method.
Yeah, I am finding that I can execute a query that will find the Incidents that have at least 1 Journal - Note, but it can't find results if I say
There are no Journal Notes where all of the following are true:
Journal.JournalTypeName equals Journal - Note
I have even tried using the JournalTypeID
After you've added your related clause, you can then add another comparison clause to add filters to the related items. I think even just tapping 'new' at this point will start off another comparison clause, but if not you may need to utilize the dropdown.
Just select the 'There are no journals' line in the diagram there and then add another comparison clause, and you'll find the fields you can compare now belong to the child record in the relationship.
I believe I have already tried that. When the query is run, it displays no Records, but if I run a query to find all FCR tickets and manually look through the Journal Tabs, I see many records with no Journal - Notes