From 78c80b9b382157af3042c65e032965be5cf36dfe Mon Sep 17 00:00:00 2001 From: "noah.lancien" Date: Thu, 6 Apr 2023 08:55:01 +0000 Subject: [PATCH] Updated ticket status when created --- app/Models/Ticket.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Models/Ticket.php b/app/Models/Ticket.php index a415e11..c5da69d 100644 --- a/app/Models/Ticket.php +++ b/app/Models/Ticket.php @@ -63,8 +63,10 @@ class Ticket extends Model protected static function booted() { static::creating(function (Ticket $ticket) { - // If evolution force the ticket status on estimateTodo. - if ($ticket->type->equals(TicketType::evolution())) { + // If bug force the ticket status on takenInAccount. All the others are estimateTodo. + if ($ticket->type->equals(TicketType::bug())) { + $ticket->status = TicketStatus::takenInAccount(); + } else { $ticket->status = TicketStatus::estimateTodo(); } });