最近搜索


没有最近搜索

Create a private comment automatically



已于 2019年6月06日 发布

Step One - Create a URL Target

By creating a URL target as below (settings/extensions/add target/URL target) this will allow you to set a trigger to carry out a certain action upon the ticket that the trigger or automation ran on. 

URLhttps://domainname.zendesk.com/api/v2/tickets/{{ticket.id}}.json?ticket[comment][public]=false+

Method: PUT

Attribute name: ticket[comment][body]

Save the URL Target to something like "Auto Private Comment" and then you can use it as a target using the NOTIFICATIONS: Target trigger option.

Step Two - Create the trigger

Now set up your trigger or automation with your relevant trigger options. In the 'actions' section you can select the 'notifications: Notify Target' option and select the target you created in step one. 

Next, add the comment you want to be posted for example:

CUSTOMER HAS RECEIVED 24 HOUR NOTIFICATION EMAIL.

----

<p>Hi {{ticket.requester.first_name}}</p>

<p>We just wanted to see if you have had time to take a look at our recent email? We haven’t heard back from you and wanted to make sure we hadn’t missed you.</p>

<p>If you want to get in touch with any questions or comments you may have when you get a moment, or if you want to let us know if you need a little more time to digest the information, just hit reply. </p>

<blockquote>{{ticket.latest_public_comment_formatted}}</blockquote>

This comment will now be added as a private comment whenever the trigger actions run. 

It's excellent for setting reminders for agents who aren't using email much as it will reopen in their views. And also good for keeping track of automated messages sent to customers without needing to interpret the 'events' section of the ticket view.


0

32

32 条评论

This solved a huge headache for my team!

 

Thank you so much!

0


Thanks for the update and thanks to Austin forgetting you in the right spot! Apologies for the delay on our side!

Greg Katechis | Developer Support and Enablement Engineer

0


Just closing the loop to confirm that I was able to get this to work. Austin with Zendesk Support helped me make sure I had this set-up correctly. So it does work!

0


For whatever reason I can authenticate with POST but not with PUT. However, POST does not work in that while it authenticates, it returns and invalid end point and therefore the comment does not post.

0


Thanks 6482129967. So I now have settings as shown in my two screenshots. I can successfully log in to my Zendesk as an admin without going through my SSO service. But when I use that same username and password for the basic authentication for the HTTP target, I still get the "cannot authenticate you" error. I have submitted a ticket to Zendesk early last week but have not heard back at all.

0


Ah, yes 24054238927 -- that's no doubt it. I didn't think of that. Because the trigger method only allows for "Basic" (i.e. Zendesk username/password credentials), not having that turned on would explain 401/unable to authenticate errors. Thanks for pointing that out!

If you need to use basic authentication (as in this case), you need to have password access enabled:

Having some other auth mechanism turned on (and Zendesk auth turned off) I could see also creating this issue:

Definitely check these things.

0


Thanks Bryan followed this to a T and still cannot authenticate. So weird. Could this be related to Google SSO being the only method at which agents can sign in?

0


I know the approach in the original post has seemed to have worked in the past (passing field names and field values as query parameters) but it's not a supported or documented approach to updating a ticket. The official way of updating a ticket is to use the PUT /api/v2/tickets/{id}.json API.

Revamping the above instructions to use the documented API call, you would:

1. Create an "HTTP" target extension (not a "URL" target) using PUT method and Content Type of JSON.

2. Give the target extension a URL value of: https://your_subdomain.zendesk.com/api/v2/tickets/{{ticket.id}}

3.Enable Basic authentication and enter an agent level email and password. If you are using an "API token", the format for the email should be john@example.com/token with the password being the API token. See reference documentation for details.

4. Then, similar to the above, create a Trigger that fires on ticket creation. Have a "Notify target" action that calls the above HTTP target extension created in steps 1 thru 3

5. For the body of the trigger action's request you pass a JSON payload, similar to what's documented at PUT /api/v2/tickets/{id}.json

The trigger action's JSON for the above example would look like:

{
"ticket":{
"comment": {
"html_body": "CUSTOMER HAS RECEIVED 24 HOUR NOTIFICATION EMAIL.\r\n\r\n<hr>\r\n\r\n<p>Hi {{ticket.requester.first_name}}</p>\r\n\r\n<p>We just wanted to see if you have had time to take a look at our recent email? We haven't heard back from you and wanted to make sure we hadn't missed you.</p>\r\n\r\n<p>If you want to get in touch with any questions or comments you may have when you get a moment, or if you want to let us know if you need a little more time to digest the information, just hit reply. </p>\r\n\r\n<blockquote>{{ticket.latest_public_comment_formatted}}</blockquote>",
"public" : false
}
}
}

Note: If you're passing HTML in the JSON body, you need to set the "html_body" attribute and pass a valid JSON string.

Another note is that, technically, calling into your Zendesk instance from a target extension is not officially supported. It can work, but there are possible issues depending on the action, what other triggers are doing, and the expectation of the agent on seeing those background changes surface in the UI.

All that said, the above steps should accomplish the same action as the original post. Try that instead Pete and let us know how it works!

0


I am trying to test the PUT command in Postman and a command terminal, when I run the URL with text after "false+", nothing is added to the ticket.

Is there a way different call I should be making to test this manually?

https://domainname.zendesk.com/api/v2/tickets/{{ticket.id}}.json?ticket[comment][public]=false+test comment

0


Hi Jean-Edouard Leblond -- I suggest submitting a ticket, so your specific account can be examined more closely. 

Know that this particular workflow is not officially supported. See Can I use a trigger and a target to update tickets? for more details.

0


登录再写评论。

找不到所需的内容?

新建帖子