Automation using Conditional Logic summary match

SKAdmin
Contributor
July 9, 2024

Attempting to add some logic to our automated slack message to include an emoji when the summary contains certain words. Doesn't appear to possible, as all attempts to use summary match returns no results even when changing the summary to be just the key word. Please note - I don't want to create a series of if Advanced compare conditions, just want 1 slack message with the condition within. Any Suggestions? 

Automation 

Trigger - Transition to Closed

If Issue matches JQL

Then Send Slack Message 

{{#if(issue.summary.match(“lightning”))}}:zap:{{/}} {{issue.key}} closed

 

{{#if(issue.summary.match(“wind”))}}:dash:{{/}} {{issue.key}} closed  

 

{{#if(issue.summary.match(“cold”))}}:snowflake:{{/}} {{issue.key}} closed

 

Already looked over the documents as well, nothing outlines this scenario. 

docs/jira-smart-values-text-fields/#match--

docs/jira-smart-values-conditional-logic/

1 answer

1 accepted

1 vote
Answer accepted
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.
July 9, 2024

Hi @SKAdmin 

Perhaps try this one, which adds the grouping and wildcards to the regular expression, and then checks if the result is non-empty:

{{#if(issue.summary.match(".*(lightning).*").isNotEmpty)}}:zap:{{/}}

As needed, please adjust the regular expression if you do not want to return the search text embedded in other text.

Kind regards,
Bill

SKAdmin
Contributor
July 10, 2024

Hi Bill -  Thank you for the quick response.

Just had to make a modification to check for capital or lowercase. 

{{#if(issue.summary.match(".*([Ll]ightning).*").isNotEmpty)}}:zap:{{/}}

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events