autotask_update_ticket_charge
Update specific fields of a ticket charge without affecting others. Modify charge details like name, quantity, or billable status.
Instructions
Update an existing ticket charge. Only fields provided will be changed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chargeId | Yes | The charge ID to update | |
| name | No | Updated charge name | |
| description | No | Updated description | |
| unitQuantity | No | Updated quantity | |
| unitPrice | No | Updated unit price | |
| unitCost | No | Updated unit cost | |
| billableToAccount | No | Updated billable status | |
| status | No | Updated status |
Implementation Reference
- src/handlers/tool.handler.ts:849-853 (handler)The handler function for autotask_update_ticket_charge in the dispatch table. Extracts chargeId from args, spreads remaining fields as updates, and delegates to autotaskService.updateTicketCharge().
['autotask_update_ticket_charge', async (a) => { const { chargeId, ...updates } = a; await s.updateTicketCharge(chargeId, updates); return { result: chargeId, message: `Successfully updated ticket charge ${chargeId}` }; }], - Schema definition for autotask_update_ticket_charge. Input accepts chargeId (required), name, description, unitQuantity, unitPrice, unitCost, billableToAccount, and status.
name: 'autotask_update_ticket_charge', description: 'Update an existing ticket charge. Only fields provided will be changed.', inputSchema: { type: 'object', properties: { chargeId: { type: 'number', description: 'The charge ID to update' }, name: { type: 'string', description: 'Updated charge name' }, description: { type: 'string', description: 'Updated description' }, unitQuantity: { type: 'number', description: 'Updated quantity' }, unitPrice: { type: 'number', description: 'Updated unit price' }, unitCost: { type: 'number', description: 'Updated unit cost' }, billableToAccount: { type: 'boolean', description: 'Updated billable status' }, status: { type: 'number', description: 'Updated status' } }, required: ['chargeId'] } }, - src/handlers/tool.definitions.ts:3048-3049 (registration)Tool registered in the 'tickets' category within TOOL_CATEGORIES, listing autotask_update_ticket_charge among the ticket-related tools.
tools: ['autotask_search_tickets', 'autotask_get_ticket_details', 'autotask_create_ticket', 'autotask_update_ticket', 'autotask_get_ticket_note', 'autotask_search_ticket_notes', 'autotask_create_ticket_note', 'autotask_get_ticket_attachment', 'autotask_search_ticket_attachments', 'autotask_create_ticket_attachment', 'autotask_get_ticket_charge', 'autotask_search_ticket_charges', 'autotask_create_ticket_charge', 'autotask_update_ticket_charge', 'autotask_delete_ticket_charge', 'autotask_get_ticket_history', 'autotask_search_ticket_history'] }, - Service-layer implementation of updateTicketCharge. Calls http.update on the 'TicketCharges' entity with the charge ID and partial update data.
async updateTicketCharge(id: number, updates: Partial<AutotaskTicketCharge>): Promise<void> { const http = await this.ensureClient(); try { this.logger.debug(`Updating ticket charge ${id}:`, updates); await http.update('TicketCharges', id, updates as Record<string, any>); this.logger.info(`Ticket charge ${id} updated successfully`); } catch (error) { this.logger.error(`Failed to update ticket charge ${id}:`, error); throw error; } }