Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

fetch text with automation

FrancoB July 26, 2024

Hello everyone,
I have a problem and wanted to ask for advice: I have a field in which a table is contained. Through an automation and a regular expression I fetch words, but I noticed that it also fetches the table and cells in which the words are contained not only. Is there any way to fix this and only fetch the words?
Thanks

 

1 answer

1 accepted

0 votes
Answer accepted
Marc - Devoteam
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.
July 26, 2024

Hi @FrancoB

Welcome to the community.

Look at this community request. Tis was recently raised and resolved.

I think it is similar to what you are requesting.

https://community.atlassian.com/t5/Jira-Service-Management/Skip-Workflow-step-based-on-a-value-within-ticket/qaq-p/2751940 

FrancoB July 31, 2024

Hi @Marc - Devoteam 
thanks for the link it was really helpful to me.
Through this I was able to do partly what I needed to do:
{{issue.description.match(“(?<=\Start:\|)([^|]+)”)}}
I just have a problem that the word I need to search for “Start:” is sometimes written as a hyperlink and therefore is not considered.

Unfortunately I import the text from an email and it contains formatting, I also tried converting it .text but unfortunately I find that the word I need to extract Ex. Home is written under the word Start: and so even then it doesn't work, like this

Start:
Home

 

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.
July 31, 2024

Hi @FrancoB -- Welcome to the Atlassian Community!

IMO, the match() function in automation rules does not consistently handle things like text containing newlines, and other formatting.  As a result, it can terminate the searching earlier than expected.

A workaround for that is to first replace all the newlines before the match attempt:

{{issue.description.replace("\n", " ").match(your expression)}}

And when the newlines are needed for later processing, they may be first replaced with a known value, and then set back later.  For example:

{{issue.description.replace("\n", "~~~").match(your expression).replace("~~~", "\n")}}

Kind regards,
Bill

Like Marc - Devoteam likes this

Suggest an answer

Log in or Sign up to answer