Forums

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

Run a rule when a specific comment is made on an issue

Pasi Entaban December 7, 2023

Hi, i want a rule to run when a specific comment added to the 'Add internal notes' comment section on an issue. So for example if I comment; all done here -then my rule will run if (and only if), the comment matches 100% what I have set in the automation rules. How can this be done?

Seems everything i have tried either runs the rule for any comment, or ignores characters or spaces in the comment.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
December 7, 2023

Hello @Pasi Entaban 

Please show us what you have tried and tell us how it dod not meet your expectations in each case.

Pasi Entaban December 7, 2023

Hi @Trudy Claspill  

I tried to create a rule whereby when a specific comment was made in the comments section of an issue it would run the rule. I have now made this rule work but its just runs for any comment. I only want it to run if the issue comment is Drawing PDF Created but it seems to run even if i write something else.  All i want it to do is recognise  only a specific comment, by a specific user, and then run the rule to e-mail the issue requestor.

I am probably not understanding how to use the 'if: compare two values' step.

Capture.PNG

Trudy Claspill
Community Champion
December 8, 2023

Hello @Pasi Entaban 

I see two problems in your Compare.

First, when you use the smart value {{issue.comments}} you are telling the Automation rule that you want to look at the list of all comments associated with the issue, and look at all attributes of those comments (author, body, dates, etc.)

With the Issue Commented trigger, if you want to reference the Comment that was made that triggered the rule, you need to look at the {{comment}} smart value.

https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Issue-commented

If you want to look specifically at the text that was entered for the Comment, you need to reference the body attribute. So you need {{comment.body}} as the first element of your comparison rather than {{issue.comments}}

 

Second, it looks like the text you are comparing to has brackets of some sort around it. If you put curly brackets around it - {{text}} - then the automation rule thinks you've given it the name of a smart value, which is not what you want to do. You need to supply a value just like in the View all issues screen where you would create a filter to search for a text phrase in field, and that would to surround the text with double quotes.

"Drawing PDF Created"

https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CONTAINS----

Like Pasi Entaban likes this
Pasi Entaban December 11, 2023

Thanks @Trudy Claspill this REALLY helped! I have managed to edit the rule so it works as required!

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events