integer('parentTicket')->description('ID of the parent ticket.')->required() ->string('headline')->description('Title of the subtask.')->required() ->string('description')->description('Subtask description.') ->integer('projectId')->description('Project ID.') ->integer('editorId')->description('Assigned user ID.') ->integer('userId')->description('Creator user ID.') ->string('dateToFinish')->description('Due date in ISO8601 format.') ->integer('status')->description('Status ID.') ->string('editFrom')->description('Scheduled start date in ISO8601 format.') ->string('editTo')->description('Scheduled end date in ISO8601 format.') ->integer('effort')->description('Effort T-shirt size: 1=XS, 2=S, 3=M, 5=L, 8=XL, 13=XXL.') ->integer('planHours')->description('Planned hours for this subtask.') ->integer('priority')->description('Priority: 1=Critical, 2=High, 3=Medium, 4=Low, 5=Lowest.'); } /** * Handle the tool request. */ public function handle(array $arguments): ToolResult { $params = [ 'headline' => $arguments['headline'], 'description' => ($arguments['description'] ?? ''), 'projectId' => ($arguments['projectId'] ?? null), 'editorId' => ($arguments['editorId'] ?? null), 'userId' => ($arguments['userId'] ?? null), 'dateToFinish' => ($arguments['dateToFinish'] ?? null), 'status' => (int) ($arguments['status'] ?? 3), 'sprint' => null, 'editFrom' => ($arguments['editFrom'] ?? null), 'editTo' => ($arguments['editTo'] ?? null), 'milestone' => null, 'type' => 'subtask', 'dependingTicketId' => (int) ($arguments['parentTicket'] ?? 0), 'storypoints' => (int) ($arguments['effort'] ?? 3), 'priority' => (int) ($arguments['priority'] ?? 3), 'planHours' => (int) ($arguments['planHours'] ?? 0), ]; $result = $this->ticketsService->quickAddTicket($params); if ($result) { return ToolResult::text("Subtask created successfully. ID: {$result}"); } return ToolResult::error('Failed to create subtask.'); } }