assign_issue
Assign a Jira issue to a specific user by providing the issue key and user account ID.
Instructions
Assign a Jira issue to a user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | The issue key to assign | |
| assignee | Yes | The account ID of the user to assign to |
Implementation Reference
- src/tools/assignments.ts:62-78 (handler)Handler function that executes the assign_issue tool logic: validates args using assignIssueSchema, calls jiraClient.assignIssue(), and returns success message.
export async function handleAssignmentTool( name: string, args: Record<string, unknown>, jiraClient: JiraClient ) { switch (name) { case 'assign_issue': { const validatedArgs = await assignIssueSchema.validate(args); const _result = await jiraClient.assignIssue(validatedArgs); return { content: [ { type: 'text', text: `Issue ${validatedArgs.issueKey} assigned successfully`, }, ], }; - src/schemas/index.ts:102-106 (schema)Yup validation schema for assign_issue requiring issueKey (string) and assignee (string).
// Schema for assigning issue export const assignIssueSchema = yup.object({ issueKey: yup.string().required('Issue key is required'), assignee: yup.string().required('Assignee is required'), }); - src/tools/assignments.ts:11-27 (registration)Tool registration object defining name 'assign_issue', description, and inputSchema with issueKey and assignee required properties.
{ name: 'assign_issue', description: 'Assign a Jira issue to a user', inputSchema: { type: 'object', properties: { issueKey: { type: 'string', description: 'The issue key to assign', }, assignee: { type: 'string', description: 'The account ID of the user to assign to', }, }, required: ['issueKey', 'assignee'], }, - src/jira-client.ts:313-326 (helper)JiraClient.assignIssue() helper method that calls the Jira API to edit an issue and set the assignee's accountId.
// Assign issue async assignIssue(input: AssignIssueInput) { try { const response = await this.jira.issues.editIssue({ issueIdOrKey: input.issueKey, fields: { assignee: { accountId: input.assignee }, }, }); return response; } catch (error) { throw new Error(`Failed to assign issue: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/index.ts:90-95 (registration)Routing logic in the MCP server that dispatches assign_issue calls to handleAssignmentTool.
} else if ( name.startsWith('assign_issue') || name.startsWith('get_users') || name.startsWith('get_current_user') ) { return await handleAssignmentTool(name, args || {}, this.jiraClient);