diff --git a/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php b/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php index b946199..34c4fc0 100644 --- a/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php +++ b/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php @@ -65,6 +65,16 @@ class TicketCommunicationService $odataEntries = $this->mapODataEntries($ticketNo, $ticketLog, $soapMessageMap); } + // When OData entries are enriched with SOAP message text via soapMessageMap, + // the separate SOAP entries for those messages are redundant and cause + // duplicates. Drop SOAP message entries when the map was applied. + if ($soapMessageMap !== [] && $soapEntries !== []) { + $soapEntries = array_values(array_filter( + $soapEntries, + static fn (array $e): bool => ($e['type_variant'] ?? '') !== 'message' + )); + } + if ($actorNameMap !== []) { $odataEntries = $this->applyActorNameMap($odataEntries, $actorNameMap); $soapEntries = $this->applyActorNameMap($soapEntries, $actorNameMap);