false, 'error' => 'Invalid JSON body']); exit; } // Validation, permission check, audit log, notification and stats-cache // invalidation live in AssignmentService so the MCP assign_ticket tool runs // the same code path. $result = AssignmentService::assign($conn, $currentUser, $data); if (!empty($result['http_status'])) { http_response_code($result['http_status']); unset($result['http_status']); } apiRespond($result);