What is the "any ticket" placeholder (e.g. {{ticket.id}} ) that can be used for the update_many endpoint? | Community
Skip to main content

What is the "any ticket" placeholder (e.g. {{ticket.id}} ) that can be used for the update_many endpoint?

  • May 12, 2022
  • 3 replies
  • 0 views

Alexandra15

I am trying to set up a workflow where a tag comprised of the assignee's ID and rating is added to a ticket if the satisfaction rating changes. To create these custom tags I need to create a webhook with  endpoint of api/v2/tickets/update_many.json so I can use "additional_tags" versus just "tags" which replaces all current tags with the new one. I just want to ADD tags, not SET tags. 

When using a specific ticket in the endpoint it works perfectly, but it needs to be able to run for any ticket that matches the criteria.

So for example, the following endpoint is working:

https://xyz.zendesk.com/api/v2/tickets/update_many.json?ids=3182170

But what I need to work is something like: https://xyz.zendesk.com/api/v2/tickets/update_many.json?ids={{ticket.id}}

Does anyone know? I appreciate any clues!

3 replies

Obsa
  • May 15, 2022

How can get 


Alexandra15

Hi @ahmed11! When running the test in the Webhook page I get a 400 Bad Request error that says:

{
  "error": {
    "title": "Invalid attribute",
    "message": "You passed an invalid value for the ids attribute. Invalid parameter: ids must match \A\s*(?:(?:\d+|suspended|deleted)(?:\s*,\s*|\s*,?\s*\z))+ from api/v2/tickets/update_many"
  }
}

This is when testing with the following endpoint (xyz substituted by our domain of course):

https://xyz.zendesk.com/api/v2/tickets/update_many.json?ids={{ticket.id}}


Alexandra15

Oh! I did not fill in that ticket.id placeholder! When I used the tickets/{{ticket.id}} endpoint it wasn't needed to be a successful test so I didn't even consider it. It works!!! Thank you so much @ahmed11