Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Text replacement with breaks

Ralf Fehling
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 17, 2023

Hello everyone,

I use the mail handler from JETI to create issues based on HTML emails. This works as desired. 

Because the body has a complex table structure, the result needs improvement. I would like to use Jira Automation for this. Simple text replacementsr [replace(String target, String replacement)] work well.

I want to remove the table in the header. As can be seen in the picture, the text to be target is spread over three lines.

jira_automation.jpg

I tried to identify the breaks with different variants - \n, (\n), \r, (\r), \r\n, (\r)(\n), \\. Unfortunately without the desired success.

What am I misunderstanding?  Do you have a suggestion for me?

Thanks in advance! 

Regards Ralf

3 answers

2 accepted

0 votes
Answer accepted
Tim Perrault
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 17, 2023

Hi @Ralf Fehling 

 

So it looks like it is using wiki notation. You could grab the the first 6 pipes and just replace it with nothing.

 

regex to grab the first 6 pipes: [|]{6}

Ralf Fehling
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 20, 2023

Hi @Tim Perrault

The idea is not bad. I tried the replacement. But it doesn't work :(

image.png

 

image.png

Do you have an idea why it doesn't work?

Regards Ralf

Tim Perrault
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 20, 2023

@Ralf Fehling 

 

Yea testing that out I can't get it to work. We could just eliminate everything up to a certain point though. Are all the notifications in the same format? If so, you could use the below regex to match everything up to the 9th pipe and replace that with nothing.

^([^|]*\|){9}

 

Before

Screenshot 2023-07-20 141945.png

After

Screenshot 2023-07-20 142040.png

Like Bill Sheboy likes this
0 votes
Answer accepted
Arkadiusz Inglot
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 17, 2023

What if you use:


{{issue.description.substringAfterLast("*(color:#BE")}}

or simillar approache?

Ralf Fehling
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 20, 2023

Hi @Arkadiusz Inglot

Since I don't want to remove the entire header, this doesn't seem like a good solution for us.

Regards Ralf

0 votes
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 17, 2023

Hi @Ralf Fehling 

I respectfully suggest it can be quite difficult to remove all the possible markup from the source *and* not lose any content within an automation for Jira rule.  If you can find a way to send the source email as plain text, perhaps try that first.

Kind regards,
Bill

Ralf Fehling
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 18, 2023

Hi @Bill Sheboy

we get the mail from an external agency. Unfortunately, it is not possible for us to select the output medium.

In order not to lose information, I want to define and replace the target as precisely as possible.

Attached is a sample and my current automation rules: EML-File / Automation-rule 

Regards
Ralf

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events