assign_issue
Assign Jira issues to specific users using account IDs or email addresses, or remove assignments by setting assignee to -1 for proper task allocation.
Instructions
Assign a Jira issue to a user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignee | Yes | User account ID, email (will auto-lookup account ID), or "-1" to unassign | |
| issueKey | Yes | The issue key to assign (e.g., PROJ-123) |
Implementation Reference
- src/handlers/issue-handlers.ts:230-272 (handler)The main handler function that implements the assign_issue tool logic. It validates inputs, resolves assignee to account ID (or unassigns if '-1'), makes a PUT request to the Jira API endpoint `/issue/{issueKey}/assignee`, and returns a success or formatted error message.async handleAssignIssue(args: any) { try { const { issueKey, assignee } = args; if (!issueKey || !assignee) { throw new Error('issueKey and assignee are required'); } let assigneeData; let assigneeText; if (assignee === '-1') { assigneeData = { accountId: null }; assigneeText = 'unassigned'; } else { // Auto-resolve email to account ID if needed const accountId = await this.userHandlers.resolveUserToAccountId(assignee); assigneeData = { accountId: accountId }; assigneeText = `assigned to ${assignee}`; } await this.apiClient.put(`/issue/${issueKey}/assignee`, assigneeData); return { content: [ { type: 'text', text: `✅ Issue ${issueKey} ${assigneeText} successfully!`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: JiraFormatters.formatError(error), }, ], isError: true, }; } }
- src/tools/definitions.ts:97-114 (schema)The input schema and metadata definition for the assign_issue tool, including description and required parameters.{ name: 'assign_issue', description: 'Assign a Jira issue to a user', inputSchema: { type: 'object', properties: { issueKey: { type: 'string', description: 'The issue key to assign (e.g., PROJ-123)', }, assignee: { type: 'string', description: 'User account ID, email (will auto-lookup account ID), or "-1" to unassign', }, }, required: ['issueKey', 'assignee'], }, },
- src/index.ts:104-105 (registration)The dispatch registration in the main server switch statement that routes assign_issue tool calls to the IssueHandlers.handleAssignIssue method.case 'assign_issue': return this.issueHandlers.handleAssignIssue(request.params.arguments);