Power Scripts - Line break in a validator message Edited



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

Accepted Answer
1 vote
Alexey Matveev Community Champion Jan 02, 2018


Kindly try \n


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
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

20,655 views 2 7
Join discussion

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