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", "
", "
", " ", "<br>", "<br />"
Hi Adam,
Try using "\\\\" for line break.
Taha
Thanks Taha, unfortunately this just got me a bunch of slashes in my description.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You were right, my slashes we just pointing the wrong way. Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it should just
issue.description = 'Some Text.\nNext line of text."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie, I tried this as well at /r/n and both just printed out the characters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Replace \n
with <br>
: Use replaceAll("\n", "<br>")
to replace newline characters with HTML line breaks before setting the error message.
summaryField.setError(errorMessage.replaceAll("\n", "<br>"))
This approach ensures that the error message is displayed with line breaks in environments where \n
might not be interpreted correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.