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!
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
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
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.