Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

The automation rule in JIRA only works from the second comment

mirunadriana February 18, 2021

Hello, Jira Masters! :D

I created a new project in Jira and I added to it this automation rule:

Capture1.PNG

Long story short: When I add a comment with a keyword on the task, I want its status to change. For example:

 --- Keyword "Approved" / Moved from "Waiting for Hiring Manager" to "Approved for TI"

---- Keyword "Declined" / Movem from "Waiting for Hiring Manager" to Rejected

 

Now my problem is that this automation rule does not work at first and I have to add another comment (any comment) to receive the trigger and change the status. After that, the status changes.

 

Please note that I've already tried to put only one keyword (only approved) in the rule and it still doesn't work at first. I also tried without the first IF (status equals - Waiting for Hiring Manager) and it still didn't work.

 

Any ideas what am i doing wrong and how can i make it work from the first comment? :)

 

Thank you,

Miruna

2 answers

1 accepted

2 votes
Answer accepted
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.
February 18, 2021

Hi @mirunadriana 

Interesting problem.

Try this in your condition.

{{comment.body}} contains "Keyword"

Add advanced compare condition.

Let me know if this works.

Ravi

mirunadriana February 18, 2021

Omg, omg! It wooorked!

 

I am very happy and I am so sorry because there are no emoticons here to celebrate :)) (I've been trying to make it work for a while)

Thank you so much, @Ravi Sagar _Sparxsys_

 

Now that I've discovered this part, do you have any idea if I can add something next to the keyword? (for example same word written in uppercase or lowercase)

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.
February 18, 2021

Hi @mirunadriana 

I am glad it worked. Basically you were using comment ~ "Keyword" which was doing a JQL search and finding issues with the keyword but what we wanted to do was to focus only on the comment.

Yes you can have more text in the comment. For ensuring lowercase as well I suggest you to use "contains regular expression" so you can find tune your search based on your exact needs.

Ravi

Like Mykenna Cepek likes this
mirunadriana February 18, 2021

Noted!

Thank you, thank you so much for all the info @Ravi Sagar _Sparxsys_

Have a great day :)

0 votes
Mykenna Cepek
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.
February 18, 2021

Have you looked at the Audit Log after running the rule for the first time? If it didn't work, there should (might?) be a warning, error, or clue in the Audit Log as to why.

mirunadriana February 18, 2021

Yes, I checked the messages there and it's always the same:

capture2.PNG

1. The moment I added the first comment

2. The moment I added the second comment

 

It's weird that the rule still takes into account the first message, although the status does not change.

I also tried to wait longer to see if something changes after the first comment and nothing happens..

Mykenna Cepek
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.
February 18, 2021

I see that Ravi's info helped you get this solved, which is great.

Note that the Audit Log was trying to tell you that your conditional wasn't working like you expected. If you see the message "did not match the condition" when you expect that it should match, then questioning the syntax or configuration of the condition is a good next step.

A lot of people overlook the value of the Audit Log in trying to get rules to work as expected. I like to use the "Log action" liberally while developing / debugging a rule, to help me see what's going on.

Happy automating!

Like mirunadriana likes this
mirunadriana February 22, 2021

Thank you so much @Mykenna Cepek for the info!

Suggest an answer

Log in or Sign up to answer