Skip to main content
Glama
hackdonalds

JIRA MCP Server

by hackdonalds

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
NameRequiredDescriptionDefault
issueKeyYesThe JIRA issue key
transitionIdYesThe transition ID
commentNoOptional comment for the transition

Implementation Reference

  • 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;
      }
    }
  • 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;
        }
      }
    );
  • 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)
      });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hackdonalds/jira-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server