I've fount a part of logic. It locates in ScriptLibrary "interoperabilityHelpers" and Ioaction "PM.open.incidents".
I suppose it would be suitable for earler SM's version.
Still it is interesting for SM 9.60 version
The subject has got some perspectives.
Well as far as I could find out since you created (or associated) a new relation between Problem and Incidents , a schedule record has been produced. The schedule runs PM.open.incidents ioaction there the rest count magic happens 🙂
I don't know why this was done this way and stay the same in 9.6.. honestly, it makes no sense, it would be much better and simpler calculate it directly on trigger or even on FC/Ruleset.. all fields used in the query are indexed.
If you feel this was helpful please click the KUDOS! thumb below!