Skip to main content
Glama

jira_create_issue

Create new Jira issues by specifying project, summary, issue type, description, priority, assignee, and labels to track tasks, bugs, or stories in your workflow.

Instructions

Create a new Jira issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyYesProject key
summaryYesIssue summary
issueTypeYesIssue type (e.g., Bug, Task, Story)
descriptionNoIssue description
priorityNoPriority name
assigneeNoAssignee username
labelsNoLabels

Implementation Reference

  • MCP tool handler: validates input parameters using CreateIssueSchema, constructs the issue creation payload, calls jiraClient.createIssue, and returns the created issue as JSON.
    case "jira_create_issue": {
      const {
        projectKey,
        summary,
        issueType,
        description,
        priority,
        assignee,
        labels,
      } = CreateIssueSchema.parse(args);
      const issue = await jiraClient.createIssue({
        fields: {
          project: { key: projectKey },
          summary,
          issuetype: { name: issueType },
          ...(description && { description }),
          ...(priority && { priority: { name: priority } }),
          ...(assignee && { assignee: { name: assignee } }),
          ...(labels && { labels }),
        },
      });
      return {
        content: [{ type: "text", text: JSON.stringify(issue, null, 2) }],
      };
    }
  • src/index.ts:251-274 (registration)
    Tool registration: defines the tool name, description, and input schema in the ListTools response.
    {
      name: "jira_create_issue",
      description: "Create a new Jira issue",
      inputSchema: {
        type: "object",
        properties: {
          projectKey: { type: "string", description: "Project key" },
          summary: { type: "string", description: "Issue summary" },
          issueType: {
            type: "string",
            description: "Issue type (e.g., Bug, Task, Story)",
          },
          description: { type: "string", description: "Issue description" },
          priority: { type: "string", description: "Priority name" },
          assignee: { type: "string", description: "Assignee username" },
          labels: {
            type: "array",
            items: { type: "string" },
            description: "Labels",
          },
        },
        required: ["projectKey", "summary", "issueType"],
      },
    },
  • Zod input validation schema matching the tool's inputSchema, used to parse arguments in the handler.
    const CreateIssueSchema = z.object({
      projectKey: z.string().describe("Project key"),
      summary: z.string().describe("Issue summary"),
      issueType: z.string().describe("Issue type (e.g., Bug, Task, Story)"),
      description: z.string().optional().describe("Issue description"),
      priority: z.string().optional().describe("Priority name"),
      assignee: z.string().optional().describe("Assignee username"),
      labels: z.array(z.string()).optional().describe("Labels"),
    });
  • JiraClient helper method: sends POST request to /rest/api/2/issue endpoint to create the issue.
    async createIssue(data: JiraCreateIssueRequest): Promise<JiraIssue> {
      return this.request<JiraIssue>("/issue", {
        method: "POST",
        body: JSON.stringify(data),
      });
    }
  • TypeScript type definition for the createIssue request payload used by the JiraClient.
    export interface JiraCreateIssueRequest {
      fields: {
        project: { key: string };
        summary: string;
        description?: string;
        issuetype: { name: string };
        priority?: { name: string };
        assignee?: { name: string };
        labels?: string[];
        [key: string]: unknown;
      };
    }

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/yogeshhrathod/JiraMCP'

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