Create a private comment automatically | The place for Zendesk users to come together and share
Skip to main content
June 6, 2019

Create a private comment automatically

  • June 6, 2019
  • 32 replies
  • 120 views

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.

32 replies

Brett Bowser
Community Manager
June 6, 2019

This is awesome!

Thanks for sharing Kev :)

June 20, 2019

Hey Kev! 

I've followed your instructions but the client call is failing- not super familiar with setting up an extension, do you have any tips on how to make sure it works?

Cheers!

Brett Bowser
Community Manager
June 24, 2019

Hey Ayryn,

Looks like there haven't been any updates on this post regarding your question.

Have you navigated to Admin>Channels>API>Target Failures to confirm the failure type you're running into?

You'll also want to be careful when using triggers to provide updates on tickets as there can be some odd behavior. I'd recommend taking a look at the following article for more information: Can I use a trigger and a target to update tickets?

Hope this points you in the right direction!

July 8, 2019

Thanks Kev!

This is exactly what i needed to do.  I will still need to test it but it is pretty straight forward.

Thanks again,

Yami  :=]

July 9, 2019

Hi Kev,

I tested and i am getting HTTP Errors; can it be because i did not place a User/Password?  If so, what would this be, my sign on ID and Password?

Thanks,

Yami

Brett Bowser
Community Manager
July 9, 2019

Hey Yamile,

Credentials shouldn't be required here but you can try adding them to see if that resolves the issue. Username would be the email address you use to log into your Support account and the password would be the same as your login password.

Hope this helps!

July 9, 2019

Hi Kev,

Thanks for the confirmation, 

I am still having the same error 401

"error": "Couldn't authenticate you"

I am not sure where to go from here?

 

HTTP/1.1 401 Unauthorized  
Date Tue, 09 Jul 2019 15:01:49 GMT
Content-Type application/json; charset=UTF-8
Content-Length 37
Connection close
Set-Cookie __cfduid=de597194bed2891a892a0a2b059df58151562684509; expires=Wed, 08-Jul-20 15:01:49 GMT; path=/; domain=.farelogixpartnersupport.zendesk.com; HttpOnly
WWW-Authenticate Basic realm="Web Password"
Strict-Transport-Security max-age=31536000;
Cache-Control no-cache
X-Zendesk-Origin-Server app59.pod13.usw2.zdsys.com
X-Request-Id 4f3b2ce6a8a72a47-SEA
X-Runtime 0.054535
X-Zendesk-Request-Id 53013f6df620e5fa7293
Expect-CT max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server cloudflare
CF-RAY 4f3b2ce6a8a72a47-SEA
{
  "error": "Couldn't authenticate you"
}
SFPAuthor
July 9, 2019

I’ll take a quick look at my settings in the office tomorrow and hopefully get back with a solution :-)

July 9, 2019

Thanks Kev! 

Dan Cooper
Contributor
July 15, 2019

You may need to check your API Admin page to ensure you have password access enabled.  

You might also consider using a token instead of an agent password. If you use a token your user name would be email@domain.com/token (replacing the email address with your address of course). Your password would be your API token.