how to mass delete cc on a ticket via API
AnsweredHi there,
I have a case where I need to reset the cc values with new ones. The issue is that I don't know the cc that are already set on that field and I cannot use this kind of payload described in the documentation:
{
"ticket": {
"email_ccs": [
{ "user_id": "562624", "action": "put" },
{ "user_id": "243642": "action": "delete" },
{ "user_email": "else@example.com", "user_name": "Someone Else", "action": "put"}
]
}
}
This payload assume that you know which values are already set on the CC field.
Working on collaborator_ids set to null is not an option as there may have followers on the ticket that cannot be deleted.
Any idea/suggestion on how to CC mass delete ?
thank you
Andreas
-
You could take a two step approach:
One: do a PUT on the /api/v2/ticket/ID.json with the following code:
{ "ticket": { "email_ccs": [] } }
This will clear out all existing CCs.
Wait a bit, and then run another cycle of PUT with the new values in the array.
Kinda similar to this approach: https://support.zendesk.com/hc/en-us/community/posts/209285958-Removing-ALL-CCs-from-a-ticket-via-a-Trigger-Target But updated for the current split between CC and Followers.
-
Hi Thomas,
This payload doesn't work neither. In summary:
{
"ticket": {
"follower_ids": []
}
}AND
{
"ticket": {
"email_ccs": []
}
}are KO !
The only following payload works (remove all ccs and followers):
{
"ticket": {
"collaborator_ids": []
}
} -
Perfect.
I'll update my own documentation too ;-)
-
I wouldn't say it is perfect, but rather annoying :
You cannot delete/reset the followers or the cc's, but only delete/reset cc's AND followers via the collaborator_ids.
If zendesk gives for both a different meaning (which is the case and a good idea), this should be a must have to have same api behaviour for collaborator_ids, follower_ids and email_ccs
Please sign in to leave a comment.
4 Comments