Adding tags to tickets without overwriting existing tags Follow

Comments

6 comments

  • Avatar
    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,

  • Avatar
    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.

  • Avatar
    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

  • Avatar
    Nathan McClain

    Thank you very Charles!

  • Avatar
    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.

  • Avatar
    Josh Hunsaker

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

Please sign in to leave a comment.

Powered by Zendesk