Historic process instances query with the filter withIncidents combined with orQueries provides incorrect results

Hi folks,

we experience that Camunda V7.18 Java / REST API for (historic) process instances provide incorrect results in some specific cases - or do you see an error on our side?

We try to query specific historic process instances with the filter " withIncidents" and “orQueries” (processVariableA == “value1” OR processVariableA == “value2” )"

The search result contains processes with incidents but also processes without incidents.
We have identified, that the SQL Query is created with “left join” instead of an “inner join”:

By the way, the search result is correct, if we do not combine “withIncidents” with “orQueries” (e.g. search for a single variable, only)
image

Thanks for your feedback!
Bernd

.

I created a bug and it was accepted: Historic process instances query withIncidents combined with orQueries provides incorrect results · Issue #3182 · camunda/camunda-bpm-platform · GitHub