assign_ticket
Assign Jira tickets to specific team members using account IDs to manage workload distribution and ticket ownership.
Instructions
Assign a ticket on Jira on the api /rest/api/3/issue/{issueIdOrKey}/assignee. Do not use markdown in your query.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | The account id of the assignee | |
| issueIdOrKey | Yes | The issue id or key |
Implementation Reference
- src/index.ts:678-699 (handler)The core handler function that executes the tool logic by sending a PUT request to the Jira API to assign the ticket (issue) to the specified accountId.async function assignTicket( accountId: string, issueIdOrKey: string, ): Promise<any> { try { const response = await axios.put( `${JIRA_URL}/rest/api/3/issue/${issueIdOrKey}/assignee`, { accountId, }, { headers: getAuthHeaders().headers, }, ); return response.data; } catch (error: any) { return { error: error.response.data, }; } }
- src/index.ts:212-224 (schema)Input schema definition for the assign_ticket tool, specifying required string parameters accountId and issueIdOrKey.inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'The account id of the assignee', }, issueIdOrKey: { type: 'string', description: 'The issue id or key', }, }, required: ['accountId', 'issueIdOrKey'],
- src/index.ts:208-226 (registration)Tool registration in the MCP tools array, defining the name, description, and input schema.{ name: 'assign_ticket', description: 'Assign a ticket on Jira on the api /rest/api/3/issue/{issueIdOrKey}/assignee. Do not use markdown in your query.', inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'The account id of the assignee', }, issueIdOrKey: { type: 'string', description: 'The issue id or key', }, }, required: ['accountId', 'issueIdOrKey'], }, },
- src/index.ts:884-901 (handler)MCP request handler case that dispatches the assign_ticket tool call, validates inputs, invokes the assignTicket function, and formats the response.case 'assign_ticket': { const accountId: any = request.params.arguments?.accountId; const issueIdOrKey: any = request.params.arguments?.issueIdOrKey; if (!accountId || !issueIdOrKey) { throw new Error('Account id and issue id or key are required'); } const response = await assignTicket(accountId, issueIdOrKey); return { content: [ { type: 'text', text: 'Ticket assigned : ' + JSON.stringify(response, null, 2), }, ], };