diff --git a/server/controllers/ticket/change-department.php b/server/controllers/ticket/change-department.php index 22679a0d..5cea221d 100755 --- a/server/controllers/ticket/change-department.php +++ b/server/controllers/ticket/change-department.php @@ -66,10 +66,13 @@ class ChangeDepartmentController extends Controller { $ticket->addEvent($event); $ticket->department = $department; $ticket->unread = true; + if(!Controller::getLoggedUser()->sharedDepartmentList->includesId($department->id)) { + $ticket->owner = null; + } $ticket->store(); Log::createLog('DEPARTMENT_CHANGED', $ticket->ticketNumber); Response::respondSuccess(); } -} \ No newline at end of file +}