I want to add a tag to the ticket whenever a 'Light agent' comments on a ticket. What am I doing wrong?

Answered

6 Comments

  • Jacob the Moderator
    Community Moderator

    HiKaran 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.

    0
  • Karan Singh

    Thanks! That clears my confusionJacob 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?

    0
  • Jacob the Moderator
    Community Moderator

    HeyKaran Singh

    Sure thing. If you are setting up a webhook for the first time,Stephen Belleauhas a great guide (for another use case) inthis 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 theActionssection, select "Notify active webhook" and select the webhook you created previously. In theJSON bodyyou 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 thatthe 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.





    0
  • Karan Singh

    Wow! I can't believe it worked.

    Thank you so muchJacob the Moderator.

    1
  • Jacob the Moderator
    Community Moderator

    Karan Singh

    我很高兴听到它啊ut 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.

    0
  • Karan Singh

    Jacob the ModeratorWe'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. :)

    1

Pleasesign into leave a comment.

Powered by Zendesk