create_issue
Create a new JIRA issue by specifying project key, issue type, summary, description, and additional fields to track work items.
Instructions
Create a new JIRA issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | The project key where the issue will be created | |
| issueType | Yes | The type of issue to create (e.g., "Bug", "Story", "Task") | |
| summary | Yes | The issue summary/title | |
| description | No | The issue description | |
| fields | No | Additional fields to set on the issue |
Implementation Reference
- src/index.ts:317-344 (handler)MCP CallToolRequest handler case for 'create_issue': validates input parameters and delegates to JiraApiService.createIssue method, returning the created issue as JSON text content.case "create_issue": { // Basic validation if ( !args.projectKey || typeof args.projectKey !== "string" || !args.issueType || typeof args.issueType !== "string" || !args.summary || typeof args.summary !== "string" ) { throw new McpError( ErrorCode.InvalidParams, "projectKey, issueType, and summary are required", ); } const response = await this.jiraApi.createIssue( args.projectKey, args.issueType, args.summary, args.description as string | undefined, args.fields as Record<string, any> | undefined, ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], }; }
- src/index.ts:134-162 (schema)Input schema definition for the 'create_issue' tool, specifying required fields (projectKey, issueType, summary) and optional fields (description, fields).inputSchema: { type: "object", properties: { projectKey: { type: "string", description: "The project key where the issue will be created", }, issueType: { type: "string", description: 'The type of issue to create (e.g., "Bug", "Story", "Task")', }, summary: { type: "string", description: "The issue summary/title", }, description: { type: "string", description: "The issue description", }, fields: { type: "object", description: "Additional fields to set on the issue", additionalProperties: true, }, }, required: ["projectKey", "issueType", "summary"], additionalProperties: false, },
- src/index.ts:131-163 (registration)Tool registration in ListTools response: defines name, description, and inputSchema for 'create_issue'.{ name: "create_issue", description: "Create a new JIRA issue", inputSchema: { type: "object", properties: { projectKey: { type: "string", description: "The project key where the issue will be created", }, issueType: { type: "string", description: 'The type of issue to create (e.g., "Bug", "Story", "Task")', }, summary: { type: "string", description: "The issue summary/title", }, description: { type: "string", description: "The issue description", }, fields: { type: "object", description: "Additional fields to set on the issue", additionalProperties: true, }, }, required: ["projectKey", "issueType", "summary"], additionalProperties: false, }, },
- src/services/jira-api.ts:381-406 (helper)Core implementation of issue creation: constructs payload with project, summary, issue type, optional description/fields, and performs POST request to JIRA REST API /rest/api/3/issue.async createIssue( projectKey: string, issueType: string, summary: string, description?: string, fields?: Record<string, any> ): Promise<{ id: string; key: string }> { const payload = { fields: { project: { key: projectKey, }, summary, issuetype: { name: issueType, }, ...(description && { description }), ...fields, }, }; return this.fetchJson<{ id: string; key: string }>("/rest/api/3/issue", { method: "POST", body: JSON.stringify(payload), }); }