Why that complicated?
There should be a build in Filter in the OOTB Database called "By Configuration Item Filter".
Just add this Filter to your window and as soon a CI is selected you will see all Incidents related to that one CI.
There is also a build in Filter "By User" that is supposed to do the same but only for a populated Raise User.