Hey There,
My requirement is like customer will send a request through email and it will create a ticket in Jira service management
so there is one filed called Destination URL
so when customer mention the url in the email body i want through automation it should fetch from description and assign to custom field(Destination URL) but i don't know what is the problem it is not fetching from description to the custom field(Destination URL) , and i am getting success message also in audit log
please tell me is there a problem in regex pattern(regular expression) or any other problem is there?
my regex patten in edit rule condition is ==> {{issue.description.match("Destination URL\\s*:\\s*(https?://[^\\s]+)")}}
and i tried with other regex pattern also, but not working. even i am getting success in audit log
why it is not catching from description to custom field please look into it.
The automation documentation is unclear what is (and is not) supported in regular expressions for the match function. Instead it states (with emphasis added by me):
The underlying implementation is based on Java's Pattern class and uses Matcher.find() to find matches.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--
There are multiple community posts describing regular expressions that work with a variety of construct definitions which do not work in rules.
As it is unclear what works and does not, I recommend trying the simplest expression that can possibly work, test, and then incrementally add to the expression until done, or it stops working. That will give you something that at least partially matches.
Two things are certain to me:
The rule matcher does not handle line breaks well, and may lead to missed matches. The workaround for that is to always split on newlines first before matching, such as with this:
{{issue.description.split("\n").match(your match expression)}}
Perhaps try that first before altering the expression further.
Next, there appear to be parsing order problems for regular expressions and the match() function. The workaround for that is to first store the expression with Create Variable and then use that in the action. For example:
Destination URL\\s*:\\s*(https?://[^\\s]+)
{{issue.description.split("\n").match(varRegEx)}}
That technique also helps when creating a dynamic regular expression which contains data from an issue field.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.