jira_create_issue
Create a new Jira issue in a specified project with configurable fields including type, priority, assignee, labels, components, and custom fields. Supports multiple description formats.
Instructions
Creates a new Jira issue in the specified project. Supports setting issue type, priority, assignee, labels, components, and custom fields. Description format is controlled by the "format" parameter (default: markdown). For required custom fields, supply them via customFields (e.g., { "customfield_12345": { id: "..." } }). Returns the created issue with all details.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | Project key where the issue will be created | |
| summary | Yes | Issue summary/title | |
| description | No | Issue description. Accepts plain text or ADF object. | |
| issueType | Yes | Issue type (e.g., Bug, Story, Task) | |
| priority | No | Issue priority | |
| assignee | No | Assignee account ID | |
| labels | No | Issue labels | |
| components | No | Component names | |
| customFields | No | Additional Jira field mappings, e.g. { "customfield_12345": value }. Use for required custom fields. | |
| returnIssue | No | When false, skip fetching full issue after creation | |
| format | No | Description format: "markdown" (converts Markdown to ADF), "adf" (use as-is ADF object), "plain" (converts plain text to ADF with basic formatting). Default: "markdown" | markdown |
Implementation Reference
- src/tools/create-issue.ts:82-123 (handler)Tool handler function that validates input via Zod schema, builds createParams, calls createIssue() API helper, and returns formatted success/error response.
export async function handleCreateIssue(input: unknown): Promise<McpToolResponse> { try { const validated = validateInput(CreateIssueInputSchema, input); log.info(`Creating issue in project ${validated.projectKey}...`); const createParams: any = { projectKey: validated.projectKey, summary: validated.summary, issueType: validated.issueType, }; if (validated.description !== undefined) createParams.description = validated.description; if (validated.priority !== undefined) createParams.priority = validated.priority; if (validated.assignee !== undefined) createParams.assignee = validated.assignee; if (validated.labels !== undefined) createParams.labels = validated.labels; if (validated.components !== undefined) createParams.components = validated.components; if (validated.customFields !== undefined) createParams.customFields = validated.customFields; if (validated.format !== undefined) createParams.format = validated.format; let issueOrKey; if (validated.returnIssue === false) { issueOrKey = await createIssue(createParams, { returnIssue: false }); } else { // Default behavior: request full issue; keep API surface compatible with tests issueOrKey = await createIssue(createParams); } if (validated.returnIssue === false) { const key = typeof issueOrKey === 'string' ? issueOrKey : (issueOrKey as any).key; log.info(`Created issue ${key}`); return formatSuccessResponse(`Issue created: ${key}`); } const issue = issueOrKey as any; log.info(`Created issue ${issue.key}`); return formatIssueResponse(issue); } catch (error) { log.error('Error in handleCreateIssue:', error); return handleError(error); } } - src/tools/create-issue.ts:14-80 (registration)Tool definition/registration with name TOOL_NAMES.CREATE_ISSUE ('jira_create_issue'), description, and JSON Schema input schema for MCP tool registration.
export const createIssueTool: Tool = { name: TOOL_NAMES.CREATE_ISSUE, description: 'Creates a new Jira issue in the specified project. Supports setting issue type, priority, assignee, labels, components, and custom fields. Description format is controlled by the "format" parameter (default: markdown). For required custom fields, supply them via customFields (e.g., { "customfield_12345": { id: "..." } }). Returns the created issue with all details.', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'Project key where the issue will be created', }, summary: { type: 'string', description: 'Issue summary/title', minLength: 1, }, description: { anyOf: [{ type: 'string' }, { type: 'object' }], description: 'Detailed issue description (optional). Format depends on the "format" parameter.', }, issueType: { type: 'string', description: 'Issue type name (e.g., Bug, Story, Task, Epic)', }, priority: { type: 'string', description: 'Issue priority name (e.g., High, Medium, Low) - optional', }, assignee: { type: 'string', description: 'Assignee account ID (optional)', }, labels: { type: 'array', items: { type: 'string' }, description: 'Issue labels (optional)', default: [], }, components: { type: 'array', items: { type: 'string' }, description: 'Component names (optional)', default: [], }, customFields: { type: 'object', additionalProperties: true, description: 'Additional Jira fields, e.g. { "customfield_10071": value }. Use this to set required custom fields.', }, returnIssue: { type: 'boolean', description: 'If false, returns only the issue key without fetching full details', default: true, }, format: { type: 'string', enum: ['markdown', 'adf', 'plain'], description: 'Description format: "markdown" (converts Markdown to ADF, default), "adf" (use as-is ADF object), "plain" (converts plain text to ADF with basic formatting)', default: 'markdown', }, }, required: ['projectKey', 'summary', 'issueType'], }, };