CRM-15201 fix case get related contacts query