How to leave whitespace when using Behaviour to create default description text?

Majken Longlade December 4, 2019

Using Behaviours to set default description text, following this example https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html#_setting_a_default_description

 

The problem is that it doesn't leave whitespace under the headings for the user to click in and start typing. I can't figure out how to leave an empty line between headings. Anyone have ideas?

2 answers

1 vote
Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2019

Hi @Majken Longlade,

I'm not sure I got your question correctly. but if my understanding right you want one space should be added as a value in new line under heading.

if so you can use like below

\n --> for new line

\t --> for tap space 

def desc = getFieldById("description")

def defaultValue = """How to reproduce
* step 1 \n\t
* step 2 \n\t"""
if (!underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}

 tap-space.png

BR,

Leo

Majken Longlade December 5, 2019

Hi Leo,

Thanks that is what I'm trying to achieve, but it's only working in the text view. It's not working in the visual editor.

I'm on Jira Data Center 7.13.9 and using ScriptRunner for Jira version 5.6.8

Any other ideas?

Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2019

Hi, 

since you set wiki style renderer, will have to find out wiki markup style to achieve this

I haven't worked much with markup styles, following page may give you some idea: https://www.mediawiki.org/wiki/Help:Formatting

but not sure how far these styles will work with jira

 

BR,

Leo

Majken Longlade December 17, 2019

I think the visual editor is just stripping the white space. I tried a few things, they all worked in the text editor but not the visual editor.

 

I ended up using placeholder text.

Martin S_ October 7, 2020

@Majken Longlade - I just found a solution that works also in the Visual Editor of Jira:

'\\\\'  --> you have to use 4 backslashes in the script to produce empty lines in Jira visual editor :)

Cheers, Martin

Like # people like this
0 votes
Dmitry Lebedev October 18, 2022

Try use NBSP symbol, that is working for me.

Suggest an answer

Log in or Sign up to answer