Fix query to find the closest group integration
What does this MR do?
After propagating group-level integrations, all the inheriting integrations have the same settings and inherit_from_id
set with the id from which they are inheriting the values.
When retrieving the default integration in order to restore the administration settings (those coming from the group or the admin instance), we need to look for the closest group integration which does not inherit from its parent. Basically, the closest with inherit_from_id = nil
.
Group-level integrations are under group_level_integrations
feature flag, so this fix has no impact to any user as the feature is not available for them at the moment.
Related to #263225 (closed)
Edited by Arturo Herrero