Power Scripts - Line break in a validator message

Błażej O_
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 2, 2018

Hi,

 

I want my SIL validator to return a following message:

"Following fields cannot be empty:
* Field1
* Field2"

 

However, when validator returns above message, it removes all line breaks and condenses everything to a single-line sentence.:

"Following fields cannot be empty:* Field1* Field2"

I've tried all the nice and nasty tricks that came to my mind, and none of these worked:

* putting \n instead of normal line breaks

* putting \\\\

* putting <br>

putting &#13;&#10;

* returning array of strings instead of a single string

 

Is there any workaround to achieve a multiline validator message through SIL?

2 answers

1 accepted

1 vote
Answer accepted
Alexey Matveev
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 2, 2018

Hello,

Kindly try \n

Błażej O_
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 2, 2018

Hi,

I mistyped slashes here, but of course in the code I've tried "\n" (already corrected above).

On screen it was just removed from message, but didn't cause it to break into new line.

Alexey Matveev
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 4, 2018

I just made some research. You will not be able to do it because the message is escaped in Jira's vm template.

Like Reply Test Group likes this
Błażej O_
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 4, 2018

Dang, Wish I could escape escaping by injecting code in right format:) Anyway, thanks for the effort and finding a source of the problem!

0 votes
Evgeniy Russkikh January 3, 2018

I always typing “\r\n” (without quotes) for line breaks with sil or JavaScript 

Błażej O_
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 3, 2018

Good hint:) Unfortunately not working in validation message.

Like Reply Test Group likes this
Konstantin Iakovlev February 23, 2019

\t\n

Suggest an answer

Log in or Sign up to answer