Auto CC user(s) on Condition (Ticket Create)



Posted Sep 12, 2016

There are many different uses for the CC option. The instructions below are just for CC'ing a particular person based on the creation of a ticket where the value of a field is True.

I use several CC logic. One which fires via a macro. Everything should be here to get you started anyway... Good luck!

 

Step (1) – The Field Admin>Manage>Ticket Fields

  1. Firstly you will need to create a new drop-down field and add your values to it. The example below shows a ‘CC Third Party Repairer’ field for two companies. (NOTE: Once created, you'll need to return back to this field and take note of the Custom field ID)

 

Step (2) – The Form Admin>Manage>Ticket Forms

  1. Click on your form to edit it.
  2. Add your newly created field to your Form by dragging and dropping it in the prefered order.
  3. Refresh your Zendesk in order for the field to show.

 

Step (3) – The Dynamic Content; 

  1. Under Admin>Manage>Dynamic Content - Add a Dynamic item
  • Give the Dynamic Content a meaningful name (title)
  • Select the language type
  • Type the content as shown below

Notice the placeholders for the Field ID and tags, taken from above. The full email address for each company is also required.

Step (4) – The Field Admin>Settings>Extensions>Add Target>URL target

Select the Url target option near the top right

 

  1. Give the Target a meaningful title
  2. Url; https://yourdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json+?ticket[collaborators]={{dc.third_party_email_mobile_repairers}}

Note: The placeholder '{{dc.third_party_email_mobile_repairers}}' is the name of the Dynamic title created in Step 2 above.

 

Step (5) – The Triggers; There are 4 triggers in total, 2 for each company.

  1. Under Admin>Business Rules>Triggers - Add Trigger
  • Depending on your 'Use Case' you'll need to create a trigger for each company (or any field the rule-event is based on). The example below shows the logic set-up for “Company 1”. The following rules/conditions is based on the condition that the ticket is created and value "Company Name 1 (repairs@companyname1)" is selected from the field.


NOTE: Just above (common practice) we remove the tags from company 2, just in case they were there previously. Outlined in Blue we add and then nulify the tag to prevent it from fireing in a loop.

 



The 'Update' Trigger; Here we have another trigger should you want to update/change the CC for another company. (again, depends on 'Use Case')

  • The below shows the logic set-up for “Company 1”. The following rules/conditions is based on the condition that the ticket is updated and value "Company Name 1 (repairs@companyname1)" is selected from the field.

NOTE: Just above (common practice) we remove the tags from company 2, just in case they were there previously. Outlined in Blue we add and then nulify the tag to prevent it from fireing in a loop.

 

 

IMPORTANT NOTE: To remove the CC you should create another trigger, (if xxx field is blank) ensuring you create an action to remove all tags.

That's it.. you should be done.

 

Not Working? 

  1. Go to; Admin>Settings>Extensions>Edit Target
  2. Re-type over your password
  3. Update Target
  4. Submit

:-)

 


0

29

29 comments

Hi. I still did't figure out why I can't make it work with email_ccs, but I found out that by using additional_collaborators instead of collaborators, the existing CCs are preserved.

I hope this will help somebody...

Just a drawback: adding an agent will make him an invisible follower, it's pitty when you want him to reply directly to the requester. I suppose it's inherent to collaborator property. I tested disabling follower, but then the agent is not added at all...

0


Hi there !

I tried this method succesfully but indeed this replaces existing CCs. I read that email_ccs property is prefered to collaborators and that it doesn't remove existing CCs, so I tried an URL target with ticket[email_ccs] instead of ticket[collaborators] but it doesn't work. Any idea why ?

Otherwise, Mark's method is good for simple cases, but I have at least 6 different CC's upon the choice of a custom field, plus some others depending on a few other fields, so it looks like this will oblige me to multiply triggers and it won't be simple to update.

0


I successfully implemented this for my company, however it seems that migrating to the recently updated "CC/Followers experience" breaks this workflow. Any insight on if there is a simple fix/alteration to this workflow to continue auto-cc'ing external email addresses?

 

EDIT: Figured out a much simpler way to achieve this using an HTTP Target

 

URL : https://[your-url-prefix].zendesk.com/api/v2/tickets/{{ticket.id}}.json
Method : PUT
Content type : JSON

 

Then create a trigger with your relevant conditions (ticket is created, subject text contains the following string, etc.), and then the action is -

Notify Target : [HTTP target created with step above]

JSON Message :

{
"ticket": {
"email_ccs": [
{ "user_email": "john.smith@company.com", "user_name": "John Smith", "action": "put"},
{ "user_email": "jim.johnson@company.com", "user_name": "Jim Johnson", "action": "put"}
]
}
}

 

You can use further JSON language to automatically add comment text or tags based on your conditions, although adding tags requires a slightly different URL in a separate HTTP target.

0


Hi Uriel, 

Can you provide some screenshots of what you have setup in the various areas?  I think that will help narrow down where you are caught here. 

0


Got it. I was able to to create all the steps, but for some reason the trigger is not cc'ing the user with the added email address in step 3.

0


Hello, 

Are you triggering this from a trigger or via a Test Target on the Target page?  This would only work if it was initiated by a ticket change via a Trigger or Automation because it needs to data from the placeholders you have included in the URL. 

You screenshot make me think you are testing it from the Target page which won't work.

0


Gotcha. I copied the URL with the place holder and got the following error:

Thanks,

Uriel

0


Hi Uriel, 

The URL appears to be: https://yourdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json+?ticket[collaborators]={{dc.third_party_email_mobile_repairers}}. 

The Ticket ID is inserted via the {{ticket.id}} placeholder.  The original example also includes a placeholder for Dynamic Content that looks interchangeable with whatever placeholder you need to insert to include your own list of CCs. 

0


Hi Brett,

Thanks for your response. I was referring to the URL itself. Is the URL targeted to a specific ticket? 

Thanks,

Uriel

0


Hi Uriel,

In step 4 you would need to navigate to Admin(gear icon)>Settings>Extensions>Targets>Add Target>URL Target. Screenshot below:

You would input the URL mentioned above in the field I've highlighted but replace yourdomain with your Zendesk account subdomain.

Hope this helps!

0


Sign in to leave a comment.

Didn't find what you're looking for?

New post