Implement parent child ticket hierarchy

This commit is contained in:
2026-03-25 08:35:17 +01:00
parent 1ff8f5d68f
commit 3b31e6bb7d
13 changed files with 617 additions and 46 deletions
@@ -39,6 +39,7 @@ class UpdateProjectTicket
$ticket->loadMissing([
'fieldValues.ticketFieldDefinition',
'fieldValues.userValue',
'parentTicket',
'project',
'ticketPriority',
'ticketType',
@@ -104,6 +105,18 @@ class UpdateProjectTicket
$summaryLabels[] = 'priority';
}
if ($ticket->parent_ticket_id !== $ticketAttributes['parent_ticket_id']) {
$newParentTicket = $ticketAttributes['parent_ticket_id'] === null
? null
: Ticket::query()->find($ticketAttributes['parent_ticket_id']);
$changes['parent_ticket'] = [
'from' => $ticket->parentTicket?->ticket_key,
'to' => $newParentTicket?->ticket_key,
];
$summaryLabels[] = 'parent ticket';
}
$ticket->fill($ticketAttributes);
if ($ticket->isDirty()) {