Search code examples
ruby-on-railsrubyapizendeskzendesk-api

How to reopen a closed ticket using the Zendesk API


My objective is to reopen a closed Zendesk ticket through the Zendesk API.

I tried to update the field "open" through

https://support.XXXXXX.com/api/v2/tickets/XXXXX.json

and got the response:

{
    "error"       => "RecordInvalid", 
    "description" => "Record validation errors", 
    "details"     => {
        "status" => [
            {
                "description" => "Statut : the status Close prevent the ticket update"
            }
        ]
    }
}

Is there a solution, or do I have to open a new ticket?

I am actually using the "Official Ruby Zendesk API Client", but the issue is in the API side so it is not related to the gem.

I will send a ticket to Zendesk support also, but I hoped someone on Stack Overflow might have the answer.


Solution

  • Unfortunately you can not reopen a ticket that was closed.

    The documentation is "Creating follow-up tickets". In the API you can also find details of how to create a follow-up ticket:

    curl https://{subdomain}.zendesk.com/api/v2/tickets.json \
      -d '{"ticket": {"via_followup_source_id": 103, "comment": {"body": "my message"}}}' \
      -v -u {email_address}:{password} -X POST -H "Content-Type: application/json"