Script Runner - Description formatting

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

Hi Adam,

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

Taha

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

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

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

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

1 votes

I think it should just 

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

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

0 votes

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,945 views 12 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot