Power Scripts - Line break in a validator message Edited

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
Alexey Matveev Community Champion Jan 02, 2018

Hello,

Kindly try \n

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 Community Champion Jan 04, 2018

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

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

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

Good hint:) Unfortunately not working in validation message.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

713 views 6 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you