Skip to content
← Back to Index

Message: ticket.applyCommands

Applies a list of commands to a Ticket. You can send in several commands in one request for batch processing. However, if one command fails, the entire message fails.

Schema

Body
commandsarray of command An array of [Ticket commands](/resources/actors/custom/ticket/commands/) to be applied. If any command fails, the asset will not be updated and the message will fail.
Response Type string

Relevant Rule Hook

This Rule Hook is run every time an applyCommands message is sent to a Ticket:

Example: Add a Tag to a Ticket

Add a Tag to a Ticket In this example, we will add a `newTicket` tag to an existing Ticket instance. **Request**
```json [{ "type": "applyCommands", "body": { "commands": [ { "type": "addTag", "key": "newTicket" } ] } }] ```
**Response** ``` HTTP/1.1 200 OK --- { "paths": [ "resources/actors/custom/ticket/0199a9b6-8608-7360-b98b-d2f9adeb2848", "resources/actors/custom/ticket/return/RE100011", "resources/actors/custom/ticket/return/return0" ], "data": { "applyCommands": "OK" } } ```

An improperly formed request will raise an INVALID_COMMAND error, while an incorrect TICKET ID or invalid URL will raise a NOT_FOUND error.

© 2024 Hantera AB. All rights reserved.