How to fetch the Team name from the comments by using Regex
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
How to fetch the Team name from the comments by using Regex.
Environment
JSM Cloud.
Solution
You can use the below logic to build an automation rule to fetch the team name from the comment
- Trigger: Comment added
- Condition: Create regex to filter and match your team name using the below regex:
First Value:
{{#issue.comments.last}}{{#if(exists(body.match(".*(Team ).*")))}}{{body}}{{/}}{{/}}
Second Value:
{{issue.comment.last.body}}
- Action: Add any action.
Please refer below screenshots:
Reference:
- https://community.atlassian.com/t5/Jira-questions/How-to-use-Smart-Values-to-get-comment-body-of-comment-that/qaq-p/2144162
- https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/