jira_transition_issue
Change the status of a JIRA issue by applying a specific transition, with an optional comment.
Instructions
Transition an issue to a new status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | The JIRA issue key | |
| transitionId | Yes | The transition ID | |
| comment | No | Optional comment for the transition |
Implementation Reference
- server.js:351-369 (handler)MCP tool handler that invokes the JiraClient to transition the issue and formats the response.async ({ issueKey, transitionId, comment }) => { logger.info('Transitioning JIRA issue', { issueKey, transitionId }); try { await jiraClient.transitionIssue(issueKey, transitionId, comment); logger.info('Successfully transitioned issue', { issueKey, transitionId }); return { content: [{ type: 'text', text: `Issue ${issueKey} transitioned successfully` }] }; } catch (error) { logger.error('Failed to transition issue', { issueKey, transitionId, error: error.message }); throw error; } }
- server.js:345-349 (schema)Input schema using Zod for validating tool parameters.inputSchema: { issueKey: z.string().describe('The JIRA issue key'), transitionId: z.string().describe('The transition ID'), comment: z.string().optional().describe('Optional comment for the transition') }
- server.js:340-370 (registration)Registration of the 'jira_transition_issue' tool with the MCP server, including schema and handler.server.registerTool( 'jira_transition_issue', { title: 'Transition JIRA Issue', description: 'Transition an issue to a new status', inputSchema: { issueKey: z.string().describe('The JIRA issue key'), transitionId: z.string().describe('The transition ID'), comment: z.string().optional().describe('Optional comment for the transition') } }, async ({ issueKey, transitionId, comment }) => { logger.info('Transitioning JIRA issue', { issueKey, transitionId }); try { await jiraClient.transitionIssue(issueKey, transitionId, comment); logger.info('Successfully transitioned issue', { issueKey, transitionId }); return { content: [{ type: 'text', text: `Issue ${issueKey} transitioned successfully` }] }; } catch (error) { logger.error('Failed to transition issue', { issueKey, transitionId, error: error.message }); throw error; } } );
- server.js:162-172 (helper)JiraClient helper method that makes the actual JIRA REST API call to transition the issue.async transitionIssue(issueKey, transitionId, comment = null) { logger.info('Transitioning JIRA issue', { issueKey, transitionId, comment }); const body = { transition: { id: transitionId } }; if (comment) { body.update = { comment: [{ add: { body: comment } }] }; } return await this.makeRequest(`issue/${issueKey}/transitions`, { method: 'POST', body: JSON.stringify(body) }); }