transition_issue
Change JIRA issue status by performing transitions with optional comments to track workflow progress.
Instructions
Change the status of a JIRA issue by performing a transition
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | The key of the issue to transition | |
| transitionId | Yes | The ID of the transition to perform | |
| comment | No | Optional comment to add with the transition |
Implementation Reference
- src/services/jira-api.ts:427-466 (handler)The core handler function that executes the Jira API transition request, including optional comment in ADF format.async transitionIssue( issueKey: string, transitionId: string, comment?: string ): Promise<void> { const payload: any = { transition: { id: transitionId }, }; if (comment) { payload.update = { comment: [ { add: { body: { type: "doc", version: 1, content: [ { type: "paragraph", content: [ { type: "text", text: comment, }, ], }, ], }, }, }, ], }; } await this.fetchJson(`/rest/api/3/issue/${issueKey}/transitions`, { method: "POST", body: JSON.stringify(payload), }); }
- src/index.ts:203-221 (schema)Input schema definition for the transition_issue tool, specifying parameters and validation.inputSchema: { type: "object", properties: { issueKey: { type: "string", description: "The key of the issue to transition", }, transitionId: { type: "string", description: "The ID of the transition to perform", }, comment: { type: "string", description: "Optional comment to add with the transition", }, }, required: ["issueKey", "transitionId"], additionalProperties: false, },
- src/index.ts:200-222 (registration)Tool registration in the listTools response, including name, description, and schema.name: "transition_issue", description: "Change the status of a JIRA issue by performing a transition", inputSchema: { type: "object", properties: { issueKey: { type: "string", description: "The key of the issue to transition", }, transitionId: { type: "string", description: "The ID of the transition to perform", }, comment: { type: "string", description: "Optional comment to add with the transition", }, }, required: ["issueKey", "transitionId"], additionalProperties: false, }, },
- src/index.ts:385-416 (handler)MCP tool dispatch handler that validates parameters and delegates to JiraApiService.transitionIssue.case "transition_issue": { if ( !args.issueKey || typeof args.issueKey !== "string" || !args.transitionId || typeof args.transitionId !== "string" ) { throw new McpError( ErrorCode.InvalidParams, "issueKey and transitionId are required", ); } await this.jiraApi.transitionIssue( args.issueKey, args.transitionId, args.comment as string | undefined, ); return { content: [ { type: "text", text: JSON.stringify( { message: `Issue ${args.issueKey} transitioned successfully${args.comment ? " with comment" : ""}`, }, null, 2, ), }, ], }; }