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/
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
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:{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.