create_ticket
Create Jira tickets by specifying project, summary, description, and issue type to track tasks, bugs, or features in your workflow.
Instructions
Create a ticket on Jira on the api /rest/api/3/issue. Do not use markdown in any field.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| summary | Yes | The summary of the ticket | |
| description | Yes | The description of the ticket | |
| issuetype | Yes | ||
| parent | No | The key of the parent ticket (the epic) |
Implementation Reference
- src/index.ts:462-515 (handler)Core handler function that creates a Jira ticket by making a POST request to /rest/api/3/issue with the provided project key, summary, description (in ADF format), issue type name, and optional parent key.async function createTicket( project: string, summary: string, description: string, issuetype: string, parentID?: string, ): Promise<any> { try { const jiraDescription = { type: 'doc', version: 1, content: [ { type: 'paragraph', content: [ { type: 'text', text: description, }, ], }, ], }; //parent is somethng like "parent": {"key": "SCRUM-19"} const parent = parentID ? { key: parentID } : undefined; const response = await axios.post( `${JIRA_URL}/rest/api/3/issue`, { fields: { project: { key: project, }, summary, description: description ? jiraDescription : undefined, issuetype: { name: issuetype, }, parent, }, }, { headers: getAuthHeaders().headers, }, ); return response.data; } catch (error: any) { return { error: error.response.data, }; } }
- src/index.ts:81-123 (registration)Tool registration in the MCP tools list, including name, description, and input schema.{ name: 'create_ticket', description: 'Create a ticket on Jira on the api /rest/api/3/issue. Do not use markdown in any field.', inputSchema: { type: 'object', properties: { project: { type: 'object', properties: { key: { type: 'string', description: 'The project key', }, }, required: ['key'], }, summary: { type: 'string', description: 'The summary of the ticket', }, description: { type: 'string', description: 'The description of the ticket', }, issuetype: { type: 'object', properties: { name: { type: 'string', description: 'The name of the issue type', }, }, required: ['name'], }, parent: { type: 'string', description: 'The key of the parent ticket (the epic)', }, }, required: ['project', 'summary', 'description', 'issuetype'], }, },
- src/index.ts:85-122 (schema)Input schema defining the parameters for the create_ticket tool: project (with key), summary, description, issuetype (with name), optional parent.inputSchema: { type: 'object', properties: { project: { type: 'object', properties: { key: { type: 'string', description: 'The project key', }, }, required: ['key'], }, summary: { type: 'string', description: 'The summary of the ticket', }, description: { type: 'string', description: 'The description of the ticket', }, issuetype: { type: 'object', properties: { name: { type: 'string', description: 'The name of the issue type', }, }, required: ['name'], }, parent: { type: 'string', description: 'The key of the parent ticket (the epic)', }, }, required: ['project', 'summary', 'description', 'issuetype'], },
- src/index.ts:761-801 (handler)MCP request handler case for 'create_ticket' that validates arguments and calls the createTicket function, returning the response as text content.case 'create_ticket': { const project: any = request.params.arguments?.project; const summary: any = request.params.arguments?.summary; const description: any = request.params.arguments?.description; const issuetype: any = request.params.arguments?.issuetype; const parent: any = request.params.arguments?.parent; if (!project || !summary || !description || !issuetype) { throw new Error( 'Project, summary, description and issuetype are required', ); } try { const response = await createTicket( project.key, summary, description, issuetype.name, parent, ); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: JSON.stringify(error.response.data, null, 2), }, ], }; } }