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?
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)
}
BR,
Leo
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try use NBSP symbol, that is working for me.
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.