Automation rule doesn't work with the keywords

mirunadriana March 2, 2021

Hello guys,

 

I really really really need your help here.

Imagine this:

The project Recruitment has an active collector and when they send a recommendation with a candidate to person X (and to the address set for the collector to create the task), their email sounds like this: "If you agree/disagree with this recommendation, please reply with Approved or Rejected"

These 2 keywords were designed for an automation rule that automatically transits the status of the task depending on the answer (in Rejected if the answer is Rejected and in Next Step if the answer is Approved"

 

Now... when the person X replies, both the text of the recruiter and the answer of person X are added to the ticket and my automation rule doesn't know how to differentiate the main answer from what the recruiter wrote ("If you agree with this recommendation, please reply with Approved and if not, with Rejected"). So there are chances that the answer will be Rejected, but the status will go in approved because he sees in the comment what the recruiter initially wrote.

 

I've tried many options with the automation rule, including:

- 2 different rules - one for the keyword Approved and one for Rejected

- the same rule that includes both words

- all of the above with "advanced compared conditions" and it works I comment separately with one of the words

 

My question is:

How can I make an automation rule take into account only the word "Rejected" if in the same comment with it is also "Please reply with Approved or Rejected"?

It would help me a lot to tell me exactly how to make the automation rule work and to be able to differentiate the keyword from what the recruiter writes in the email.

 

Everything I wrote may not be clear, but I am here if you need more information!

Thank you,

Miruna

 

 

 

 

 

 

2 answers

0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2021

Hi @mirunadriana 

You can always check for keywords in the comment body using smart values.

{{comment.body}}

There is an option in the Advanced compare condition to use "contains" condition of regular expression for doing a bit more advanced searching.

I made a video on this topic recently to demonstrate how it works.

I hope it helps.

Ravi

mirunadriana March 3, 2021

Hi @Ravi Sagar _Sparxsys_ ,

Your video is really very useful!

I will show you how it worked for me snd you will surely understand exactly where I get stuck:

 

  • My automation rule:

test 2.PNG

 

 

  • The comment where you can see two emails (one from the recruiter and another one from..John)

test 1.PNG

 

  • Normally, the status should move to approved, but it is rejected

 

test 3.PNG

 

Do you have any idea how I could make my rule ignore the first "Approved or Declined" and take into account only John's answer?

Now regardless of the answer, they go directly into rejected status.

 

Thank you!

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2021

Hi @mirunadriana 

When asking a question about automation rules, it can help to post an image of the rule.  That gives the community some context to go with your explanation/question.

I suggest that you map out the flow/scenarios you expect could happen with the messaging.  (Perhaps with a state transition diagram.)  Once you have that, you may be able to see a pattern you can use with a regular expression to parse the conditions you want in the comments. 

And as needed, perhaps use the current status, change log, or custom fields to use the prior state and so prevent the looping you note.

Best regards,

Bill

mirunadriana March 3, 2021

Hi @Bill Sheboy ,

Yes, you are right, I should have attached the rule as well.

I will show you the rule for understanding exactly where I get stuck:

 

  • My automation rule:

test 2.PNG

 

 

  • The comment where you can see two emails (one from the recruiter and another one from..John)

test 1.PNG

 

  • Normally, the status should move to approved, but it is rejected

 

test 3.PNG

 

Do you have any idea how I could make my rule ignore the first "Approved or Declined" and take into account only John's answer?

Now regardless of the answer, they go directly into rejected status.

 

Thank you!

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2021

Hi @mirunadriana 

Thanks for the image of the rule and for your explanation.

Please try using this to access only the most recent comment: {{issue.comments.last.body}}

And, I recommend that you force the values to a specific case, such as lower, to ensure no typos cause mismatches: {{issue.comments.last.body.toLowerCase}}

Finally, you can modify your condition tests to exclude the instructions before testing for a match (using Add Conditions).  For an example please see below.

Best regards,

Bill

testing for comment text.png

Suggest an answer

Log in or Sign up to answer