Adding tags to tickets without overwriting existing tags

Have more questions? Submit a request

7 Comments

  • Nathan McClain

    Good Morning,

    I have been trying to add an “ignore” tag to a set of tickets using the articles PUT request:

    curl https://cdp.zendesk.com/api/v2/tickets/update_many.json?ids=79,80,81 ^
    -d '{"ticket": {"additional_tags":["ignore"]}}' ^
    -H "Comtent-Type: application/json" ^
    -v -u {my_admin_email}:{my_admin_password} -X PUT

    Unfortunately, when I run the request I receive the following error:

    {"error":"ParameterMissing","description":"Parameter Both ticket ids and arguments must be present is required"}* Connection #0 to host cdp.zendesk.com left intact
    curl: (3) [globbing] nested brace in column 18

    Any ideas on what I am doing incorrectly?

    Thanks much,

    0
  • Nathan McClain

    Slight update to above - as it seems that closed tickets cannot have a tag added yet I ran this on an open ticket as well and received the same error.

    0
  • Charles Nadeau

    Looks like you're using curl in Windows. The Windows command prompt doesn't support single quotes but curl uses them for data payloads in requests. One solution is to move the JSON to a file and import it into the curl statement. See:

    https://support.zendesk.com/hc/en-us/articles/203691436#toc_2

    0
  • Nathan McClain

    Thank you very Charles!

    0
  • Jason Littrell

    I wanted to hug my monitor when I saw this. Thank you for writing up this article!


    At the risk of sounding ungrateful, is there an equivalent for collaborators in the works?


    Side note: I believe curl on Windows will accept a json payload surrounded by double quotes as long as the quotes within the json are escaped with a backslash, i.e.:


     -d "{ \"ticket\": { \"subject\" ... }}" ^

    Much easier to load a file from the directory, though.

    0
  • Josh Hunsaker

    This is fantastic! Does this same functionality exist to add tags to end users?

    0
  • Sergio Anarte

    Hi Nathan and the rest,

    We're having the same issue while using the update_many.json end point.

     

    {"error":"ParameterMissing","description":"Parameter Both ticket ids and arguments must be present is required"}

     

    But we have changed the quotes and it didn't work. how did you solve it at the end?

    Thank you all

    0

Please sign in to leave a comment.

Powered by Zendesk