otrs

How to update a ticket state via REST


OTRS 7.0.x provides a REST API. I've found various useful endpoints, but I can't find one where you could update the state of a ticket with a given TicketID. Is there a solution for this problem?


Solution

  • [OTRS 8.0.x isn't out yet, how do you have access to it? resolved by edit]

    You can take a look at the TicketUpdate operation. In the file is a description on what you must and what you can provide. With this you can update the ticket state via REST.

    Here's an example call for the rest interface to change the state of the ticket.

    curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/WebServiceName/RoutingOfTheOperation?UserLogin=admin&Password=1234&TicketID=1" -H "Content-Type: application/json" -d '{"Ticket":{"State":"closed"}}'  -X POST