Script Runner - Description formatting

Adam Walker August 21, 2015

I am using Script Runner to create subtasks automatically within a project. Along with this I am trying to populate a description fro these subtasks.

Using code like this:

issue.description = 'Some Text. Next line of text."

My problem is I cannot get any line break into the description. Is there a way to do this?

EDIT: Things I have tried but did not work. "////",  "//",  "/r/n",  "/n",  "&NewLine;",  "&#x0000A;",  "&#10;",  "<br>",  "<br />"

 

3 answers

1 accepted

3 votes
Answer accepted
Taha Khanzada
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.
August 22, 2015

Hi Adam,

Try using "\\\\" for line break.

Taha

Adam Walker August 24, 2015

Thanks Taha, unfortunately this just got me a bunch of slashes in my description.

Taha Khanzada
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.
August 24, 2015

Hi Adam, I have tested running this and both "\\\\" and "\n" are giving line break. Would you mind double checking again. What I can see in the description of this answer you have use *Forward Slash*(/) instead of *Back Slash* (\). Hope this helps. Taha

Taha Khanzada
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.
August 24, 2015

Hi Adam, I have tested running this and both "\\\\" and "\n" are giving line break. Would you mind double checking again. What I can see in the description of this answer you have use *Forward Slash*(/) instead of *Back Slash* (\). Hope this helps. Taha

Adam Walker August 25, 2015

You were right, my slashes we just pointing the wrong way. Thank you very much.

1 vote
JamieA
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.
August 22, 2015

I think it should just 

issue.description = 'Some Text.\nNext line of text."

Adam Walker August 24, 2015

Thanks Jamie, I tried this as well at /r/n and both just printed out the characters.

0 votes
Teresa Weeks November 30, 2017

The answers are not working for me, so I hope someone can help diagnose my problem with carriage return.  I used this: 

description: "Meetings with product team - management/leadership to design of agile roles and agile teams (scrum or kanban).   \n Create requests for JIRA project(s) to Agile Tools team"  

And got this: Meetings with product team - management/leadership to design of agile roles and agile teams (scrum or kanban). \n Create requests for JIRA project(s) to Agile Tools team

I used this:

description: "Meetings with product team - management/leadership to design of agile roles and agile teams (scrum or kanban).   \\\\ Create requests for JIRA project(s) to Agile Tools team"

And got this: 

Meetings with product team - management/leadership to design of agile roles and agile teams (scrum or kanban). \\\\ Create requests for JIRA project(s) to Agile Tools team

Any ideas?

Suggest an answer

Log in or Sign up to answer