Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging two already linked tickets can prevent the tickets being linked after the merge. #4114

Open
svenoe opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working as intended
Milestone

Comments

@svenoe
Copy link
Contributor

svenoe commented Jan 29, 2025

During ticket merge first all existing links should be transfered from the merged ticket into the "merged into" ticket, and then a link between both tickets should be created:

otobo/Kernel/System/Ticket.pm

Lines 6563 to 6571 in 9b6f633

# transfer all linked objects to new ticket
$Self->TicketMergeLinkedObjects(
MergeTicketID => $Param{MergeTicketID},
MainTicketID => $Param{MainTicketID},
UserID => $Param{UserID},
);
# link tickets
$Kernel::OM->Get('Kernel::System::LinkObject')->LinkAdd(

This seems to fail at times, which I assume is due to TicketMergeLinkedObjects() removing the previously existing link, but not deleting the cache:

otobo/Kernel/System/Ticket.pm

Lines 6824 to 6838 in 9b6f633

# Delete all links between tickets where source and target object are the same.
$DBObject->Do(
SQL => '
DELETE FROM link_relation
WHERE source_object_id = ?
AND target_object_id = ?
AND source_key = target_key
',
Bind => [
\$TicketObjectID,
\$TicketObjectID,
],
);
return 1;

Which, if the link also was of the parent child type, will let LinkAdd() run into this error:
Message => 'Another Link already exists within the same type group!',

Please confirm and fix by probably just clearing the cached links in TicketMergeLinkedObjects().

@svenoe svenoe added the bug Something isn't working as intended label Jan 29, 2025
@svenoe svenoe added this to the OTOBO 11.0.8 milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant