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

1 vote
Accepted answer

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.

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.

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
Community showcase
Published 8 hours ago in Jira

How you can achieve compact and easy-to-maintain workflows in your JIRA( Server)

This approach requires you to have the JIRA administrative rights. The main aim of this article is to help you achieve an organized, easy-to-maintain workflows in your JIRA instance thereby, reducin...

104 views 0 0
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