Forcing a Linebreak "\\" --- Issue Comment --- Groovy

JIRA Version 4.4.4 Standalone

I have a postfunction groovy script that creates a Comment within an issue.

The Comment field is configured for Wiki Style Rendering.

I'd like to have a forced linebreak within the comment --- via the groovy script.

The \\ character set produces a \ in the wiki renderer --- via the groovy script.

If I use \\\ character set, it produces an error.

Via groovy, is there an easy way to insert a linebreak for use in a comment using Wiki Style Rendering?

Thanks!

2 answers

1 accepted

It should be "\\\\". Or use single-quotes then you shouldn't need to escape, ie '\\'.

jamie

Thank you, Jamie! Have a good rest of the week.

Hi!

For line break, I usually use this (just for info, if anoyone else looking for this):

String newLine = System.getProperty("line.separator");

Gyuri

Fair play, but I don't think that's necessary unless you're planning on write a text file that can be read in windows notepad. Browsers and databases seem to treat \n correctly.

Somehow /n doesn't worked for me.

Dear György, thanks so much for this information.

> Somehow /n doesn't worked for me

Should be \n, not /n

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: https://www.icloud.com/keynote/0RyJ4VEdNUpjDpGfMhfZx9fEg#Confluence_Security_Advisor More details: https://co...

44 views 1 0
View post

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