How to Automation: Check if e-mail request contains an IPv4 adress or certain keywords

Angelo Fiore
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 10, 2024

How can I create an automation in the Jira Service Management project that checks issues received via email for specific values? I want to verify if the issue received via email contains an IP block. Keywords such as "IP," "block," "IP block," "release," and a RegEx validation for IP addresses should be considered. If the validation is successful, the ticket should be handled differently automatically. How can I set this up?

My first try looks like this, but it does not worked out for me.

{{issue.description.match("(?i)(\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b).*?(Sperre|freigeben|IP-Sperre)")}}

 

I would be very happy to receive a helpful answer!

2 answers

0 votes
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.
December 10, 2024

Hi @Angelo Fiore -- Welcome to the Atlassian Community!

A couple of FYIs that may help regarding the automation match() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--

 

1) Only the first matching group is returned, and thus more complex regular expressions may not work.

 

2) The documentations states the following, emphasis added by me: 

The underlying implementation is based on Java's Pattern class and uses Matcher.find() to find matches.

Nowhere does it state what is actually supported, or not, in the spec.  There are several community posts where people note syntaxes that work with other regex parsers that do not work with the match() function (or other functions using regex in rules).

 

I recommend starting with the simplest expression that can possibly work, write testing results to the audit log, and incrementally improving your expression until you get what is needed.

 

Kind regards,
Bill

0 votes
Matt Smith December 10, 2024

Are you attempting to query the Original Email header? If you're just looking for keyword query in your JQL you can kinda do keyword searches with "~" e.g Summary ~ "xyz", Description ~ "XYZ" or text ~ "XYZ". It's difficult to group though, so in your example would probs need to do something along the lines of 'text ~ "IP" OR text ~ "Block", OR Text ~ "IP Block" ..... which has possibility of being inaccurate unfortunately 

Suggest an answer

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

Atlassian Community Events