Recent searches


No recent searches

Zendesk API: Update Multiple Tickets at once using PUT Method? How does it look like? Javascript/Google Script



Posted Jun 18, 2022

I'm currently trying to do an API call to update multiple tickets at once using ticket IDs. These ticket IDs are stored on google Sheets since I have the script running there. I would appreciate someone sharing how to use the REST method and get it working! Thank you!

Problem: I'm not sure how to update multiple tickets using the following

If I try with 1 ticket ID, example PUT https://company.zendesk.com/api/v2/tickets/12345 This is from https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket. This will only update 1 ticket, fair.

Original Code: PUT /api/v2/tickets/{ticket_id} I know to just replace {ticket_id} with a ticket number. If I put something like https://company.zendesk.com/api/v2/tickets/{ticket_id} it will throw me an error.When it comes to multiple: (Source:

https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-many-ticketsreasonable-offset-smoker) How do I write the code in a way I can read multiple ticket ids at once without having to repeat it 10 time if there are 10 tickets?

PUT https://company.zendesk.com/api/v2/tickets/update_many

Zendesk's example is saying it like this:

{
  "tickets": [
    { "id": 1, "status": "solved" },
    { "id": 2, "status": "pending" }
  ]
}
 

0

1

1 comment

image avatar

Christopher Kennedy

Zendesk Developer Advocacy

Hey Circle Extra,
 
If the 10 tickets from your example are receiving the same update, the Update Many Tickets endpoint also allows you to bulk update.  In that case, you'd supply the set of ticket IDs to the ids URL parameter.  Example:
 
https://{subdomain}.zendesk.com/api/v2/tickets/update_many.json?ids=1,2,3
 
 

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post