Skip to main content
Glama

assign_issue

Assign a Jira issue to a specific user or unassign it using issue key and assignee details for task management.

Instructions

Assign a Jira issue to a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueKeyYesThe issue key to assign (e.g., PROJ-123)
assigneeYesUser account ID, email (will auto-lookup account ID), or "-1" to unassign

Implementation Reference

  • The main handler function `handleAssignIssue` that executes the tool logic: validates args, resolves assignee to account ID if needed (using helper), calls Jira API to assign/unassign the issue, and returns formatted success/error response.
    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,
        };
      }
    }
  • Input schema definition for the 'assign_issue' tool within the toolDefinitions array, defining parameters, descriptions, and requirements.
    {
      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)
    Tool registration in the MCP server's CallToolRequestSchema handler switch statement, routing 'assign_issue' calls to the IssueHandlers.handleAssignIssue method.
    case 'assign_issue':
      return this.issueHandlers.handleAssignIssue(request.params.arguments);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pdogra1299/jira-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server