jira_create_issue_advanced
Create detailed Jira issues with comprehensive field support including fixVersions, components, and custom fields. Use jira_get_create_meta first to discover required fields and allowed values for accurate issue creation.
Instructions
Create a new Jira issue with full field support including fixVersions, components, and custom fields. Use jira_get_create_meta first to discover required fields and allowed values.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | Project key | |
| summary | Yes | Issue summary | |
| issueType | Yes | Issue type (e.g., Bug, Task, Story) | |
| description | No | Issue description | |
| priority | No | Priority name | |
| assignee | No | Assignee username | |
| reporter | No | Reporter username | |
| labels | No | Labels | |
| components | No | Component names | |
| fixVersions | No | Fix version names | |
| affectsVersions | No | Affects version names | |
| customFields | No | Custom fields as key-value pairs (e.g., {"customfield_10001": "value"}) |
Implementation Reference
- src/index.ts:1193-1236 (handler)MCP tool handler for jira_create_issue_advanced: validates input with schema, constructs fields object handling optional fields like components, versions, customFields, and calls jiraClient.createIssueRaw to create the issuecase "jira_create_issue_advanced": { const { projectKey, summary, issueType, description, priority, assignee, reporter, labels, components, fixVersions, affectsVersions, customFields, } = CreateIssueAdvancedSchema.parse(args); const fields: Record<string, unknown> = { project: { key: projectKey }, summary, issuetype: { name: issueType }, }; if (description) fields.description = description; if (priority) fields.priority = { name: priority }; if (assignee) fields.assignee = { name: assignee }; if (reporter) fields.reporter = { name: reporter }; if (labels) fields.labels = labels; if (components) fields.components = components.map((name) => ({ name })); if (fixVersions) fields.fixVersions = fixVersions.map((name) => ({ name })); if (affectsVersions) fields.versions = affectsVersions.map((name) => ({ name })); // Merge custom fields if (customFields) { Object.assign(fields, customFields); } const issue = await jiraClient.createIssueRaw(fields); return { content: [{ type: "text", text: JSON.stringify(issue, null, 2) }], }; }
- src/index.ts:141-162 (schema)Zod input schema validation for jira_create_issue_advanced tool parametersconst CreateIssueAdvancedSchema = 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"), reporter: z.string().optional().describe("Reporter username"), labels: z.array(z.string()).optional().describe("Labels"), components: z.array(z.string()).optional().describe("Component names"), fixVersions: z.array(z.string()).optional().describe("Fix version names"), affectsVersions: z .array(z.string()) .optional() .describe("Affects version names"), customFields: z .record(z.unknown()) .optional() .describe( 'Custom fields as key-value pairs (e.g., {"customfield_10001": "value"})' ), });
- src/index.ts:555-600 (registration)Tool registration in ListTools handler including name, description, and inputSchema{ name: "jira_create_issue_advanced", description: "Create a new Jira issue with full field support including fixVersions, components, and custom fields. Use jira_get_create_meta first to discover required fields and allowed values.", 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" }, reporter: { type: "string", description: "Reporter username" }, labels: { type: "array", items: { type: "string" }, description: "Labels", }, components: { type: "array", items: { type: "string" }, description: "Component names", }, fixVersions: { type: "array", items: { type: "string" }, description: "Fix version names", }, affectsVersions: { type: "array", items: { type: "string" }, description: "Affects version names", }, customFields: { type: "object", description: 'Custom fields as key-value pairs (e.g., {"customfield_10001": "value"})', }, }, required: ["projectKey", "summary", "issueType"], }, },
- src/jira-client.ts:428-433 (helper)JiraClient helper method that performs the raw POST /issue API call used by the advanced create issue handlerasync createIssueRaw(fields: Record<string, unknown>): Promise<JiraIssue> { return this.request<JiraIssue>("/issue", { method: "POST", body: JSON.stringify({ fields }), }); }