Recent searches


No recent searches

Targets to Webhooks



Posted Dec 18, 2024

Hello, 

 

I'm hoping someone might be able to help me out. We had a URL target that has been deactivated (with the update to webhooks). This URL target (when activated by a trigger) allowed an internal note to populate on tickets. 

 

I'm attempting to convert this to a webhook but I don't understand the requested format (this was not a field on the URL target page). 

 

Has anyone found themselves here before?


0

3

3 comments

I have a few "automatic comment" webhooks and triggers. This is how I have mine setup:

 

Step 1. Create a New Webhook

 

Admin Center > Apps and Integrations > Webhooks > Create Webhook.

 

1. Select Trigger or Automation and click Next.

2. Give the webhook a descriptive name (e.g., Automatic Comment).

3. Configure the webhook as follows:

Endpoint:
https://[your subdomain].zendesk.com/api/v2/tickets/{{ticket.id}}

 

Request Method: PUT

 

Request Format: JSON

 

Authentication: Basic Authentication

 

Username: Enter the username of the account you want to use to post the comments. The comments will look like they were added by this user, so for me, I have a dedicated bot agent user for automatic comments. That way my staff knows it's a bot comment, not something from me. 

 

Password: Enter the password for the user account.

 

4. Click Create Webhook, then Finish Setup.

 

Step 2. Create or Update a Trigger

 

Admin Center > Objects and Rules > Triggers.

 

1. Either create a new trigger or edit an existing one.

2. In the Actions section:

3. Open the category and select Notify by > Active webhook.

4. Select the webhook you created in the previous step from the dropdown menu.

5. Enter the JSON code for the comment. For example:

{
 "ticket": {
   "comment": {
     "body": "This is the text that will appear on the ticket.",
     "public": false
   }
 }
}

6. Click Save to finalize the trigger.

 

That should do the trick. You can do a few things to make the JSON text better, and you can do a lot more with this code, such as making it a public comment, putting specific data into specific fields (even custom ones), etc. If you want the text to be a little more "complicated" than a single line and need a hand with that, I'd be happy to help. Just let me know the text you want to put in the format you'd like, as well as any other changes you'd like it to make, and I'll give you the JSON code for that. 

 

I hope this helps!

0


Hey everyone.

 

I've just added such a simple webhook trigger but somehow it keeps spamming and spamming the internal note. Any idea why that can happen and how to prevent this issue?

0


@Dmytro Akimov Sounds like you created a loop. What I do to avoid this is to use tags in the following way:

 

Condition

Meet ALL of the following conditions

Ticket Tags > Contain none of the following > tag1 (for example)

 

proceed with rest of the trigger's conditions

 

Actions

Add Tag > tag1

 

 

This will prevent the trigger from running over and over again. Depending on the use case, you might have to get creative in using multiple tags and create around them. If you run into any issues, let me know.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post