How does the Comment text condition work in business rules?

Return to top
Have more questions? Submit a request

28 Comments

  • Bill Sammons

    Is the check for the presence of the string case-sensitive?  Will a condition set as "hello" catch "HELLO" or "Hello"?

    0
  • Nicole S.
    Zendesk Community Team

    Hey Bill - 

    I did some testing and it does not appear to be case-sensitive, so a condition should catch all of it. 

    0
  • Jonathan Marra

    how do i create a string for two words that show up in the same comment text?  IE.  This AND that function.  This is not a String but instead a user who spelled two words anywhere in the comment text.  

     

    Website AND down.  not necessarily "website down" but website and somewhere else in the comment he mentions down.

    thank you

    1
  • Justin Smith

    Hey Jonathan,

    Justin here from the advocacy team.

    For that sort of trigger function you would want to use two separate Ticket Comment text contains the following words conditions in the All section of your trigger logic.  All items in the All section of the trigger need to be met, so if you create one condition with Ticket comment text contains: Website and another that is Ticket comment text contains: Down then both of those conditions would need to be met in order for that trigger to fire off.

    I hope that helps clear things up!

    0
  • Hamilton

    Hello Zendesk,

    We have a few emails sent out with tags for each agent from a sperate system and these tags are included within the subject line, eg #ABCDE.

    Does the condition Contains none of the following words (separated by spaces) search for a phrase within words or only the words in their entirety 

    In essence, we want to know if this condition will recognise the phrase #ABC within the tag as we have multiple users with individual tags, but first 3 letters are the same, eg, #ABCDE and #ABCGH

    0
  • Justin Smith

    Hey Hamilton!

    The condition Contains none of the following words (separated by spaces) is only going to search for the full word in its entirety.  So if you have the condition looking for ABCDE and you include ABCGH, the trigger will not fire off as that is not the exact word/phrase.

    Let us know if you have any other questions!

    0
  • Hamilton

    Thanks Justin,

    This confirms my suspicions that we would have to include the tags of multiple agents instead of just part of the tag prefix.

    I'm sure we'll come up with a workaround but thanks for the answer

    0
  • Mat Guthrie

    HI, 

    We get lots of FB Messenger tickets that start with "Get Started". Many of these contain no questions and this are just noise. However, some do contain questions in subsequent messages.

     

    If I create a trigger that close a ticket if the comment text contains the string "Get Started", if the customer then follows up with e genuine question will the trigger again close the ticket because the subject of the ticket is still :Get Started" even thouse the new comment is something different?

    Thanks

     

    Mat

    0
  • Jessie Schutz
    Zendesk team member

    Hey Mat!

    The first thing to note is that if you close the ticket, it will not re-open under any circumstance. So you'll want to make sure that you solve it instead.

    When you create your trigger, you should add an action that adds a tag, and then a condition that will only allow the trigger to run on tickets that DON'T contain that tag.

    So in your conditions you'll want to include:

    Tags > Contains none of the following > <your_tag>

    And in your actions you'll want to include:

    Add tags > <your_tag>

    The end result is that each ticket that arrived with "Get Started" in it 'your_tag' will be added, and the ticket will be Solved.

    If the user sends another message, the ticket will reopen, and the presence of 'your_tag' will prevent the auto-solve trigger from firing again.

    I hope that helps!

    0
  • Wesley Ethos

    Is it possible to check for a newline character in the comment text?
    I've attempted the following:

    • \n
    • %0A
    • '\n'
    • /\n/



    0
  • Chad Ferguson
    Zendesk team member

    Hi Wesley, thanks for your question!

    I reached out to our product team for clarification on this and found that it is expected behavior that regular expressions will not work the 'Comment Text' field for Business Rules, so it is not possible to check for new lines/line breaks. 

    This is a really interesting idea, so it would be great if you could take a moment to post this feature request along with your use-case in our Product Feedback Forum so other customers can weigh in on your idea as well. 

    I hope this helps clear things up, but please let us know if you have any other questions.

    0
  • Sarah Sanders

    I'm using Comment text: Contains at least one of the following words in a trigger that sets the priority of a newly created ticket. It keeps firing on tickets that didn't include any of the listed words & failing to fire on tickets that do.

    I've got the following listed under Meet ALL of the following conditions:

    • Ticket is Created
    • Comment text contains at least one of the following words - list of words separated by spaces
    • Tags contains none of the following - a tag unrelated to priority
    • Group is not - group that requested they manually select priority

    Nothing listed under Meet ANY of the following conditions.

    Actions:

    • Priority = Urgent
    0
  • Brett Bowser
    Zendesk Community Team

    Hi Sarah,

    I'm thinking we will need to take a look at a couple of ticket examples to determine what the cause is here. I'm going to generate a ticket on your behalf and follow-up with you in an email shortly.

    Once you receive the email stating your ticket has been created can you reply back to that with any ticket examples you have as well as a direct link to the trigger you created?

    Most likely I'll need account assumption if you could enable this using the instructions I provided that would help greatly :)

    Thanks!

    0
  • Noel S.

    Hi team! 

     

    Is there any difference between "comment" and "comment text?" In looking up how to more efficiently use our triggers, I've seen a few references to "comment" and "comment text" in close conjunction with each other as though they were different things. Am I reading this incorrectly, or are there distinctions? 

     

    Thank you!

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Noel,

    The Comment condition will allow for you to look for if the ticket comment Public, Private, Present (public or private), or Present, and requester can see the comment. The Comment Text condition will look for keywords within the comment or a string of words.

    You can find more information in the following article: Trigger conditions and actions reference

    Let me know if you have any other questions!

    0
  • Sy Sussman

    Is there a limit to how many words I can include in "Contains none of the following words"? If I have a list of 20 words, will the trigger exclude all tickets that have any of those words?

    0
  • Nicole S.
    Zendesk Community Team

    Hey Sy -

    There's not a limit to the number of words, but there is an overall 65k size limit for a trigger, so you might run up against that.

    0
  • Sy Sussman

    Hi Nicole. I don't understand what you mean by an overall 65k size limit. How would I be able to see the trigger's size?

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Sy,

    I believe what Nicole was referring to is the character limit. Basically, if you're looking to list 20 words within this condition you shouldn't run into any issues :)

    Let me know if you have any other questions!

    0
  • Pablo Dominguez

    What is the behaviour of the [Does not contain the following string] condition when the comment box was left empty? Always true or always false?

    I'm looking to detect tickets that get closed without a public comment to inform the user and this seems promising.

    0
  • Heather Rommel
    Community Moderator

    Hi Pablo Dominguez,

    If the comment box was left empty, this will not trip the Contains or Does not contain the following string last time I tested.

    I have had to create a set of Triggers -

    1. Look for Status is Changed To Solved and "Comment... Is... Present, and the requester can see the comment". Add a tag like solvedwithcomment

    2. Create a Trigger that looks for Status is Changed to Solved and Tags do not include solvedwithcomment.  Make the action - Set ticket to Open. You can set a Private comment by notifying a target or simply send an email to the assignee to tell the assignee to update the ticket with a Comment and set the ticket back to solved!

    3. Update your Solved notification trigger to your Requester and have it look for the solvedwithcomment tag in order to fire off.

    Phew!

    If your testing shows that the [Does not contain the following string] works, please do post back!

    Sincerely,

    Heather

    0
  • Garrett Galindo

    Is it possible for me to set the trigger to run anytime a specific character comes in? We're currently experiencing a Russian spam problem as we incorporate some new security and I'd like to have any Cyrillic characters in the subject or comment text to send them to a group for potential spam.

    0
  • Karen D Snyder
    Community Moderator

    @Garrett Galindo, we recently had a Russian spam problem. Due to that, I created a trigger to find created tickets with Cyrillic characters in the subject (not in the comment, because our spam tickets had Cyrillic characters in the subject but not in the comment).

    I used http://masterrussian.com/russian_alphabet.shtml to find a list of Cyrillic characters. I used all the characters there except for the ones in the group Same look and sound as in English. You don't have to worry about uppercase vs. lowercase, because the string comparison in the triggers is case insensitive. This is the beginning of the trigger conditions:

    You would also have to add a condition for each Cyrillic letter with Comment text Contains the following string, if you want to detect Cyrillic characters in the comments.

    The trigger solves the tickets without sending a request created notification, and tags them with russian_spam and no_survey (this is to prevent the customer satisfaction survey from being emailed; you have to check your automations to see if this is the correct tag for you).

    I created a view for tickets tagged with russian_spam, and then in the view I can select all and mark as spam. (Unfortunately only 100 tickets at a time can be marked as spam.) Although the step of marking them as spam adds some manual work, it's worth it because it suspends the requester, and I believe it also helps the Zendesk spam filters to learn more about spam.

    Make sure that you place the trigger in the correct place in your list of triggers; presumably it should be the first to run, so that you can catch the spam tickets.

     

    1
  • Jennifer Rowe
    Zendesk Documentation Team

    Karen, that's great. Thanks for sharing it!

    0
  • Garrett Galindo

    Thanks, Karen! This actually exactly what I put in place today and it has been a decent workaround. Hopefully, we can pinpoint a better solution in the future.

    0
  • Karen D Snyder
    Community Moderator

    We still do have spam tickets that slip through, because the Cyrillic alphabet contains some characters that are the same as English letters.

    The only way that I could come up to mark those tickets as spam was with an automation that checks the ticket description for certain strings, because the spam tickets that we received always had a URL in the comment. This was a pain, because I had to open each ticket to copy the URL to the automation (and make sure not to click the URL!). The automation looks like this, with a lot more conditions than are shown below:

    0
  • Garrett Galindo

    Hey Karen, I'm not gonna lie I got so irritated with these that I added every character in the Cyrillic alphabet that isn't shared with the English alphabet and I haven't seen one make it's a way through in the last 24 hours. 

    It would be great if "Mark as Spam" was able to be set as a ticket status or something similar in Triggers because we have never gotten a legitimate request that includes any Cyrillic. 

    0
  • Karen D Snyder
    Community Moderator

    Garrett, you just jogged my memory about why a legitimate ticket could have Cyrillic characters in the comment text. Originally the trigger did have conditions testing for Cyrillic characters in the comment text in addition to the subject text. But about a month after creating the trigger, a legitimate ticket was marked as spam! When I looked at it, I realized that the user presumably has a Russian operating system; the comment text contained Cyrillic characters which I think are the date and time:

    Luckily, I was able to change the ticket status back to Open and remove the russian_spam tag before the user noticed anything. Due to this, I removed the conditions that tested the comment text, as the spam tickets that we had received did not have Cyrillic characters in the comment text anyway. If we get an onslaught that do, I'll have to re-evaluate.

    0

Please sign in to leave a comment.

Powered by Zendesk