Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,219
Community Members
 
Community Events
168
Community Groups

How to add a carriage return before the text on a behavior

I am adding a behavior for the description field and I need the text (Acceptance Criteria) to appear a couple returns down from the field.  This is the code I am using:

def desc = getFieldById("description")

def defaultValue = """

*Acceptance Criteria:*
.
""".replaceAll(/ /, '')

if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}

 

 

1 answer

0 votes

And what is your outcome ? :-) What is going wrong ?

What is the reason of the ".replaceAll()" stuff ?

I was able to get it to work by adding \\\\.  The customer wanted to have the description populated with Acceptance Criteria but wanted an extra line so other information could be typed above Acceptance Criteria.  I couldn't get the extra line to stay but after adding \\\\ the extra line stayed.

 

def desc = getFieldById("description")

def defaultValue = """
\\\\
*Acceptance Criteria:*
.
""".replaceAll(/ /, '')

if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

190 views 1 6
Read article

Atlassian Community Events