I want to add a tag to the ticket whenever a 'Light agent' comments on a ticket. What am I doing wrong?
BeantwortetSame as title, whenever a light agent updates the case (Creating a case or updating a case), a tag should be added to the ticket.
This is working fine when they create a case, but doesn't work when the comment on an existing case (generally of another user)
Trigger:
-
Hi Karan Singh
The "Role" condition looks at the role of the requester, that is why you see it working when the light agent is the submitter/requester of a ticket, but not when they update the ticket with a comment.
I don't believe you could do this entirely using a trigger.
The above conditions would still capture private note updates from agents who are not assigned to the ticket, but leave a private note, so not exactly what you're looking for.
If you need to be more precise than that, then I think including a webhook action that uses some liquid markup conditioning to add the tag when the current user is a light agent would be a possibility.
I hope this helps, please let me know if you need more details on the more advanced route.
-
Thanks! That clears my confusion Jacob the Moderator.
I am looking for a permanent solution for this and would want to explore the webhook action. I am, however, not aware of how to use markups.
Could you guide me on this please?
-
Hey karankuwarbidxb
Sure thing. If you are setting up a webhook for the first time, Stephen Belleau has a great guide (for another use case) in this article - follow steps 1 and 2 to set up the webhook we'll need for the trigger action.
You can use the conditions I listed above as they narrow down how often the trigger will fire as much as possible and (more importantly) how many times the webhook calls that endpoint.
In the Actions section, select "Notify active webhook" and select the webhook you created previously. In the JSON body you can paste the code below.
{% if current_user.extended_role == "Light agent" %}{
"ticket": {
"additional_tags": [
"updated_by_light_agent"
]
}
}{% else %}{% endif %}The liquid markup 👆 outputs the JSON payload to add the tag "updated_by_light_agent" tag if the current user has the extended role "Light agent", if the current user doesn't have that extended role, it outputs nothing, and the webhook doesn't act.
💡 I noticed that the placeholder for {{current_user.extended_role}} is only available for accounts on the Enterprise plan, if you are not on Enterprise, the above may not work.
-
Wow! I can't believe it worked.
Thank you so much Jacob the Moderator.
-
I'm glad to hear it worked out for you! So that trigger will tag any ticket that has a description or at least one comment update created by a light agent.
It occurs to me, I never asked about the number of light agents you have, if it is a manageable number, a simpler trigger could be used, where you specify:
- "current user is" = Light agent 1
- "current user is" = Light agent 2
- "current user is" = Light agent 3
as ANY conditions.
-
Jacob the Moderator We're going to onboard a LOT of light agents. Had it been less than 20-25 i'd have used this condition.
Thanks for all the help. :)
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
6 Kommentare