Message: ticket.applyCommands
Back to IndexApplies 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
commands | array of command An array of 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
POST https://<hantera-hostname>/resources/actors/ticket/0199a9b6-8608-7360-b98b-d2f9adeb2848Authorization: Bearer <YOUR TOKEN>Content-Type: application/json
[{ "type": "applyCommands", "body": { "commands": [ { "type": "addTag", "key": "newTicket" } ] }}]curl -i -X POST \ https://<hantera-hostname>/resources/actors/ticket/0199a9b6-8608-7360-b98b-d2f9adeb2848 \ -H 'Authorization: Bearer <YOUR TOKEN>' \ -H 'Content-Type: application/json' \ -d '[{ "type": "applyCommands", "body": { "commands": [ { "type": "addTag", "key": "newTicket" } ] }}]'Invoke-WebRequest `-Uri "https://<hantera-hostname>/resources/actors/ticket/0199a9b6-8608-7360-b98b-d2f9adeb2848" `-Method POST `-Headers @{Authorization="Bearer <YOUR TOKEN>"; 'Content-Type'="application/json"} `-Body '[{ "type": "applyCommands", "body": { "commands": [ { "type": "addTag", "key": "newTicket" } ] }}]'Response
HTTP/1.1 200 OK---
{ "paths": [ "resources/actors/ticket/0199a9b6-8608-7360-b98b-d2f9adeb2848", "resources/actors/ticket/return/RE100011", "resources/actors/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.