Retrieving incidents by variable

If it’s possible for you to extend the engine in your application, maybe you could look into extending the REST API and writing your own queries for that.
Some idea how to achieve that can be found in these posts: