Implement parent child ticket hierarchy
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user