loadMissing('ticketStatus.boardColumn'); return new TicketStatusChangedPayload( eventType: NotificationEventType::TicketAssigneeChanged, projectId: $project->id, projectKey: $project->key, projectName: $project->name, ticketId: $ticket->id, ticketKey: $ticket->ticket_key, ticketTitle: $ticket->title, ticketUrl: route('projects.tickets.show', [$project, $ticket]), actorId: $actor?->id, actorName: $actor?->name, fromStatusId: null, fromStatusLabel: null, toStatusId: $ticket->ticket_status_id, toStatusLabel: $this->statusLabel($ticket->ticketStatus), occurredAt: $occurredAt, fromAssigneeId: $fromAssigneeId, fromAssigneeName: $fromAssigneeName, toAssigneeId: $toAssigneeId, toAssigneeName: $toAssigneeName, ); } private function statusLabel(?TicketStatus $ticketStatus): string { if ($ticketStatus === null) { return 'Unknown status'; } $ticketStatus->loadMissing('boardColumn'); if ($ticketStatus->boardColumn === null || $ticketStatus->boardColumn->name === $ticketStatus->name) { return $ticketStatus->name; } return "{$ticketStatus->boardColumn->name} / {$ticketStatus->name}"; } }