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

This widget could not be displayed.

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.

This widget could not be displayed.

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.

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 10 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

32 views 1 0
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