Forums

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

Need to check and get email in comment body

AldoCauchiSavona
Contributor
February 2, 2023

Is it possible in an automation rule to know if a JIRA user comments on a ticket and starts the comment with the email of a person? 

And if condition is true, that email is retreived?

 

I have test rule with a Trigger of Issue Commented and as an action I create a Variable with this smart value {{issue.comments.last.body starts with "([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)"}}.

I tried doing  JQL condition with a JQL of key="{{triggerIssue.key}}" AND comment ~ "@" to ensure that the comment has an email in it, but i am told that

  • the issue didn't match the specified JQL (most likely)
  • the chosen rule actor doesn't have permissions (or issue security level permissions) to view the issue
  • the issue was deleted or wasn't indexed by Jira yet (in rare circumstances)

2 answers

1 accepted

1 vote
Answer accepted
AldoCauchiSavona
Contributor
February 6, 2023

{{issue.comments.last.body.substringBefore("\n")}} get the first line in a comment

0 votes
AldoCauchiSavona
Contributor
February 3, 2023

I tested and managed to get the email if it is the first line on a comment with 

Screenshot 2023-02-03 092645.png

I am now validating with this advanced condition, but even if the first line is text, it still passes. The condition is as follows

 

Screenshot 2023-01-26 085639.png

Maybe my regex is incorrect?

Suggest an answer

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

Atlassian Community Events