Skip to main content
Glama
hackdonalds

JIRA MCP Server

by hackdonalds

jira_create_issue

Create new JIRA issues by specifying project, type, summary, and optional details like description, assignee, and priority.

Instructions

Create a new JIRA issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject key
issueTypeYesIssue type (e.g., Bug, Task, Story)
summaryYesIssue summary
descriptionNoIssue description
assigneeNoAssignee account ID
priorityNoPriority name

Implementation Reference

  • The main handler function for the 'jira_create_issue' MCP tool. Constructs issue data from parameters and delegates to jiraClient.createIssue.
    async ({ project, issueType, summary, description, assignee, priority }) => {
      logger.info('Creating JIRA issue', { project, issueType, summary });
      try {
        const issueData = {
          project: { key: project },
          issuetype: { name: issueType },
          summary: summary,
        };
        
        if (description) issueData.description = description;
        if (assignee) issueData.assignee = { accountId: assignee };
        if (priority) issueData.priority = { name: priority };
    
        const createdIssue = await jiraClient.createIssue(issueData);
        logger.info('Successfully created issue', { 
          issueKey: createdIssue.key,
          summary 
        });
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(createdIssue, null, 2)
          }]
        };
      } catch (error) {
        logger.error('Failed to create issue', { project, summary, error: error.message });
        throw error;
      }
    }
  • Zod-based input schema defining parameters for creating a JIRA issue.
    inputSchema: {
      project: z.string().describe('Project key'),
      issueType: z.string().describe('Issue type (e.g., Bug, Task, Story)'),
      summary: z.string().describe('Issue summary'),
      description: z.string().optional().describe('Issue description'),
      assignee: z.string().optional().describe('Assignee account ID'),
      priority: z.string().optional().describe('Priority name')
  • server.js:251-295 (registration)
    Registration of the jira_create_issue tool with the MCP server, including metadata, schema, and handler.
    // Register jira_create_issue tool
    server.registerTool(
      'jira_create_issue',
      {
        title: 'Create JIRA Issue',
        description: 'Create a new JIRA issue',
        inputSchema: {
          project: z.string().describe('Project key'),
          issueType: z.string().describe('Issue type (e.g., Bug, Task, Story)'),
          summary: z.string().describe('Issue summary'),
          description: z.string().optional().describe('Issue description'),
          assignee: z.string().optional().describe('Assignee account ID'),
          priority: z.string().optional().describe('Priority name')
        }
      },
      async ({ project, issueType, summary, description, assignee, priority }) => {
        logger.info('Creating JIRA issue', { project, issueType, summary });
        try {
          const issueData = {
            project: { key: project },
            issuetype: { name: issueType },
            summary: summary,
          };
          
          if (description) issueData.description = description;
          if (assignee) issueData.assignee = { accountId: assignee };
          if (priority) issueData.priority = { name: priority };
    
          const createdIssue = await jiraClient.createIssue(issueData);
          logger.info('Successfully created issue', { 
            issueKey: createdIssue.key,
            summary 
          });
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(createdIssue, null, 2)
            }]
          };
        } catch (error) {
          logger.error('Failed to create issue', { project, summary, error: error.message });
          throw error;
        }
      }
    );
  • JiraClient.createIssue helper method that performs the actual API POST request to create the issue via JIRA REST API.
    async createIssue(issueData) {
      logger.info('Creating JIRA issue', { issueData });
      return await this.makeRequest('issue', {
        method: 'POST',
        body: JSON.stringify({ fields: issueData })
      });
    }

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