Recent searches


No recent searches

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

image avatar

Jennifer Rowe

Zendesk Documentation Team

This looks like a great tip! Thanks for posting it, Pierre!

0


We're going to give this a try.

 

0


None of us have the Ticket Forms option, so we can't get the Dynamic title for step 4, and it just grinds to a halt. Tried substituting titles from other areas and no dice - since ZenDesk just rolled out a ton of updates, is there a new way to configure this?

0


@ Amanda

Afraid not,

You'll need this step. There's no other option to my knowledge.

Pierre 

0


image avatar

Dan Cooper

Community Moderator

I'm trying to accomplish this a slightly different way but haven't been able to get it to work. I would like to Auto CC someone based on a custom user text field that includes an email address.  I'm trying to use the placeholder for {{ticket.requester.custom_fields.auto_cc}} (where auto_cc is the key for my user field) in the dynamic content and I'm not getting the URL target to populate this.  Mine isn't using any of the liquid markup logic, just the placeholder.  Any ideas? 

EDIT: I was testing in the sandbox, but put my main subdomain in instead of the sandbox.  I was able to Auto CC based on a user field using these instructions. It also worked for multiple email addresses separated by a comma.  I was able to get it to work without using Dynamic Content as well.  I just replaced the DC placeholder with the user field placeholder along the way. 

0


Daniel Cooper

Can you explain in more detail your steps and how they differ from the above instructions?  Really need this functionality.  Thanks !!!

0


image avatar

Dan Cooper

Community Moderator

Dustin, 

I did a few things different than above.  Instead of setting Step 1 up as a ticket field, I set it up as a user field.  That user field is a text field where I put an email address in.  

You can skip step 2 & 3. 

In step 4, you do everything the same, except at the end of the URL you replace the DC placeholder with the placeholder for your custom user field.  The format is {{ticket.requester.custom_fields.<<user field key>>}} (replace <<user field key>> with the key on your user field.)

Step 5 is the same, except you'll swap the DC placeholder with the custom field placeholder again in the message to the target.  

I did figure out that by doing this, you overwrite any CC's that are already on the ticket.  I haven't solved for that.  You can also send multiple email addresses from that user field by putting a comma in between each. 

0


image avatar

Dan Cooper

Community Moderator

I didn't test it in all cases, but just in case: on the creation of the trigger, add a check to only use Auto CC if the custom user field is present.  This way you don't wipe out a CC on a ticket if it had some pre-existing CCs and the field is blank on the user profile. 

0


This was awesome and super helpful as a boiler plate.  I simplified quite a bit by just using a custom Organization field called Account Owner Email that I fed in to dynamic content by using a single line of placeholder content

 {{ticket.organization.custom_fields.account_owner_email}}

wired up to the trigger, the result is that Account Managers will be added to the cc list automatically for any new tickets opened by organizations they are listed for in the Account Owner Email field.  Not sure why Zendesk makes this so hard, but it would have been much harder w/o the tip for using the HTTP PUT method on the API directly as the custom target.

0


image avatar

Jennifer Rowe

Zendesk Documentation Team

That's great, Rob. Thanks for sharing your modifications!

0


While this seems to add a contact to the CC field after a ticket is opened it does not seem to email that CC when the ticket is opened. Since this is adding the CC with a trigger after opening a ticket they do not get CC'd on the initial email that the ticket was opened. Is there an easy way to fix that?

0


@Kyle the Zendesk AEs just sent this out in their May updates outreach email.  Try it and let us know how it goes!

https://support.zendesk.com/hc/en-us/community/posts/115007507688-How-to-send-auto-response-to-CCs

 

 

0


Thank you,

For some reason even though this 2nd trigger (auto-response trigger) is lower on the priority list than my initial "add cc" trigger, the contact is still getting added as a CC after the auto response is added so no email is being sent via cc.

I have even set it so my initial "add cc" trigger will add a tag that the 2nd trigger looks for. STILL...the auto comment is being added before the user gets added as a CC.

0


Interesting.  Thats probably because the triggers fire asynchronously and your CC field is not actually updated before the next trigger fires.  Maybe try an automation instead where you won't have to worry about that--the drawback being of course the time delay between the ticket creation and the notification.  Otherwise you'll probably have to write a custom app to handle a specific order of operations and check that the CC field is updated before adding a comment used for the "auto-reply".

0


@Kyle: Rob is right. This tip will not send out an email to the CC when a ticket is created or updated. It will add a CC to the ticket that when the next comment is made on the ticket, are eligible to get a notification.

If you are just after creating a CC notification for requests created through the request form in Guide, you could tweak a trigger as described in the link Rob referenced (with the side-effect that there will be two comments in the initial response). 

And if you are looking to add agents (full or Light) to CC on a ticket, that is available as a trigger action and will work fine.

But there is no straightforward way to add end-users as CCs and at the same update send out email notifications to those end-users in Zendesk, at the moment.

The Email Target is another option, but will create new tickets on reply and not update the original ticket, so it isn't really comparable to adding a CC ticket collaborator in Support.

There is a popular request to add better support for CC operations (like adding end-users to CC) if you want to vote on it: Add end-user as CC via Trigger or Automation

0


Two comments in the initial response are fine, but as stated in my previous post, the triggers are not firing in order so the cc contact is still be added after the 2nd comment is added to the ticket resulting in that they still are not getting copied when the ticket is opened.

0


Update:
Rather than using a 2nd trigger I added my 2nd "Notify Target" to the same trigger (at the end of it) and it is now firing in the proper order.

Unfortunately I am still not functioning properly as the auto comment being added still does not generate a cc email. Only when I manually add a comment does that work. I am going to make a post on: https://support.zendesk.com/hc/en-us/community/posts/115007507688-How-to-send-auto-response-to-CCs

0


Hello,

So I've tried to set the same thing up on our account, but I cannot seem to get it to work. I believe the error starts on the Admin>Extension page.

This is my setup:

URL is: https://ourdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json+?ticket[collaborators]={{dc.cc_digst}}

Can someone tell me if I've done something wrong? The CC e-mailaddress is not a Zendesk user at our end (should it be?).

Is there an easier way to set it up now?

Thanks in advance.

0


I have a question, where do I refer my URL link in step 4?

0


image avatar

Brett Bowser

Zendesk Community Manager

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


Hi Brett,

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

Thanks,

Uriel

0


image avatar

Dan Cooper

Community Moderator

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


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

Thanks,

Uriel

0


image avatar

Dan Cooper

Community Moderator

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


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


image avatar

Dan Cooper

Community Moderator

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


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


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


Please sign in to leave a comment.

Didn't find what you're looking for?

New post