Is there a way to get a regex match to write on the summary?

Elizabeth LC
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!
January 20, 2023

Hello!

The title of my issue is on the description. I want to put it on my summary when the issue is created. The title is always between "Titre:" and "Client" in the description.

The regex (?<=Titre :\s).*(?<!Client) works fine on regex 101 :
2023-01-20 10_09_22-regex101_ build, test, and debug regex — Mozilla Firefox.png

I tried to use the Edit field on the automaton and the advanced version.

Edit field :
{{issue.description.match("(?<=Titre :\s).*(?<!Client)")}}

Advanced version :
{
"fields": {
"summary": {{issue.description.match("(?<=Titre :\s).*(?<!Client)")}}
}
}

Am I missing something to make the regex work or it's something other then Match that I need to use?

Thanks!

1 answer

1 accepted

3 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2023

Hi @Elizabeth LC and welcome to the community,

I would use {{issue.description.substringBetween("Titre", "Client")}}

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.
January 20, 2023

Hi @Elizabeth LC  -- Welcome to the Atlassian Community!

Adding to Alex's answer...

Your original regular expression was missing a capture group for the value you wanted, and you marked the other groups as non-capture.  You could try inverting to remove the parentheses grouping for the prefix and suffix and only include them around the desired capture with (.*)

And even with those changes...the documentation for the automation rule match() function says the implementation of regex is based on the Java one, and so perhaps all of the regex features you are using are not supported.  Just something to note for the future.

Kind regards,
Bill

Elizabeth LC
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!
January 20, 2023

{{issue.description.substringBetween("Titre", "Client")}}
I added it on the edit field summary and it works like a charm.
Thanks!

Like # people like this

Suggest an answer

Log in or Sign up to answer