assign_ticket
Assign an ITSM ticket to a specific user by providing ticket ID and user ID, with support for multiple systems including ServiceNow, Jira, Zendesk, Ivanti Neurons, and Cherwell.
Instructions
Assign a ticket to a specific user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticket_id | Yes | ID of the ticket to assign | |
| user_id | Yes | Username or ID of the user to assign to | |
| system | No | ITSM system to use | jira |
Implementation Reference
- index.js:140-147 (handler)Core handler function for assign_ticket: looks up the ticket by ID, assigns it to the given user_id, updates the timestamp, and returns the result.
function assignTicket({ ticket_id, user_id }) { const ticket = tickets.get(ticket_id); if (!ticket) return { success: false, error: `Ticket ${ticket_id} not found` }; ticket.assignee = user_id; ticket.updated_at = new Date().toISOString(); tickets.set(ticket_id, ticket); return { success: true, ticket: { id: ticket.id, title: ticket.title, assignee: user_id, system: ticket.system } }; } - index.js:269-288 (registration)MCP server.tool registration for 'assign_ticket' with Zod schema validation for ticket_id and user_id parameters, annotations, and the async handler that delegates to the assignTicket function.
server.tool( 'assign_ticket', 'Assign a ticket to a specific user', { ticket_id: z.string().describe('ID of the ticket to assign'), user_id: z.string().describe('Username or ID of the user to assign to'), system: systemSchema.optional(), }, { title: 'Assign Ticket', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, async ({ ticket_id, user_id }) => { const result = assignTicket({ ticket_id, user_id }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }, ); - index.js:273-275 (schema)Zod schema defining the input parameters for assign_ticket: ticket_id (string), user_id (string), and optional system (enum).
ticket_id: z.string().describe('ID of the ticket to assign'), user_id: z.string().describe('Username or ID of the user to assign to'), system: systemSchema.optional(), - Frontend MCPService helper that wraps the assign_ticket tool call for use in the browser/client application.
async assignTicket(ticketId, userId, system = null) { return this.callTool('assign_ticket', { ticket_id: ticketId, user_id: userId, ...(system && { system }), }); }