Initialize multiline field with JETI regular expression

Michael Schlueter
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.
August 18, 2016

I'm trying to create JIRA issues based on an incoming email using the JETI plugin. I've created field initialization rules to initialize the JIRA fields. The email contains XML-style data, so I can use this kind of regular expression "<tag>(.*)</tag>" which extracts the data and fills the JIRA field. However, this works only if the data does not contains a line break, because the "." matches everything but newline. How can I specify a regular expression that can be used for multiline text aswell?

 

1 answer

1 accepted

2 votes
Answer accepted
Petar Petrov (Appfire)
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.
August 18, 2016

I haven't used JETI, but assuming that it uses the Java Pattern class, you should be able to use the embedded flag (?s) to match new lines:

&lt;tag&gt;(?s)(.*)(?-s)&lt;/tag&gt;

This is equivalent to enabling the DOTALL flag.

 

Michael Schlueter
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.
August 19, 2016

This works perfectly well! Thanks a lot!

Suggest an answer

Log in or Sign up to answer