Finish off Jira automation with smart value

Irina_Bel{Stiltsoft}
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 29, 2022

Hi, community,

I need a piece of advice. I've implemented an automation rule that has a condition to check the body of the last message. But, it only works when a message has no paragraph.

See what I mean:

The message that should be checked:

image (38).png

I type this text in the condition of the automation rule:

image (39).png

But it only works when the initial message looks like this:

image (40).png

What can I add to the field in the Condition to make it check paragraphs as well?

3 answers

1 accepted

3 votes
Answer accepted
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.
April 29, 2022

Hi @Irina_Bel{Stiltsoft} 

Have you tried to use replace() to substitute a space or empty string for the newline character before the test?  For example:

{{issue.comments.last.body.replace("\n","")}}

 

Kind regards,
Bill

Irina_Bel{Stiltsoft}
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 5, 2022

@Bill Sheboy  Thank you for your advice. I'll check that. But I've also found a workaround. Instead of the Equals I opted for Contains and checked only the part of the text in the message. It works. But it seems like your method is more reliable. I'll check that and let you know. Thank you very much!image (42).png

Like Bill Sheboy likes this
0 votes
Geert de Vries October 12, 2022

You could use the 'trim' function aswell, this will remove all  character with a code smaller or equal than '\u0020' -> example {{issue.summary.trim()}}, this will remove all spaces, linefeeds and so on from the string.

0 votes
Irina_Bel{Stiltsoft}
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 5, 2022

@Bill Sheboy  Thank you very much it works as well! But you need to add a space in quotes:{{issue.comments.last.body.replace("\n"," ")}}

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.
May 5, 2022

Well done!

Like Irina_Bel{Stiltsoft} likes this

Suggest an answer

Log in or Sign up to answer