Recent searches


No recent searches

Trigger for ticket assignment for a new message on closed ticket

Answered


Posted Nov 17, 2023

Hi,

I am trying to create a trigger to automatically assign a ticket to the last agent who talked to the customer, when the customer answers a close ticket.

So far the only solution I found is to make a trigger for each agent (if the ticket is closed and the agent is *** then assign to that agent), but would really like to make it work in only one trigger.

Looking forward to hear your solutions on this!

Best,

Andrea


0

7

7 comments

image avatar

Francis Casino

Zendesk Customer Care

Hello Andrea,
 
By default, you can not assign a follow-up ticket to the assignee of the ticket at the moment they closed. As a workaround, create a workflow through the use of triggers and tags for each agent to achieve this goal. You can achieve that by following the instructions in this article

1


Hi Andrea,

You might be able to do it with just two webhooks and triggers.

First, you need a new ticket field to save the assignee ID. Then, use a webhook for PUT /api/v2/tickets/{{ticket.id}}.json with the body: { "ticket": { "custom_fields": [{"id": YOUR_FIELD_ID, "value": "{{ticket.assignee_id}}"}] }}. A trigger should call this webhook when the ticket is resolved.

Now, create a new trigger for follow-up tickets which calls the webhook with a reverse action, transferring the value from the custom field back to the assignee_id.

Throughout the week, if I have time, I will develop it further for you.

1


Thank you for your answers!

I had not found the first article so I'll start with this.

Thank you Rafa, I have never worked with webhooks so it might take me some time before I understand this all.

1


Hi!

There is the detailed solution. I just tested it, and it works fine.

  1. First create a text field and copy his ID.
  2. Create a webhook:
    PUT https://YOUR_SUBDOMAIN.zendesk.com/api/v2/tickets/{{ticket.id}}.json
  3. Then the first trigger, for get the ID of the assignee, the basic condition is
    Ticket Status category > Changed to > Solved
    and the action
    Notify by > Active webhook > your webhook
    with the JSON body
    { "ticket":{ "custom_fields":[{"id": THE_ID_OF_YOUR_FIELD, "value": "{{ticket.assignee.id}}"}] }
  4. Now the second trigger for the follow-up tickets. Conditions:
    Ticket Channel > Is > Closed ticket
    Ticket Status category > Is > New
    Action:
    Notify by > Active webhook > your webhook
    JSON body
    { "ticket": { "assignee_id": "{{ticket.ticket_field_THE_ID_OF_YOUR_FIELD}}" } }

I hope it works well, otherwise let me know.

1


Thanks Rafa D. 

 

What would happen in the case the agent is deleted? Where will the ticket go then?

 

Thanks!

1


The ticket remains unassigned.

1


Thanks!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post