The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Additional editing is not allowed in default added description with behaviour add-on

Jovita Sajonaite
January 10, 2020

Hello,

I added default text to description field via Behaviour plugin.

My code looks like this:

def descField = getFieldById("description")

def defaultValue = """
*Expected result:*"""

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

I can add my additional text into this prefilled field, but when I switch to another field to fill in, my added text disappears and just default text stays.

I tried another code with $currentValue, but it's still the same problem.

I also tried to add 

descField.setAllowInlineEdit(true)

this option, but still my additionally added text disappears.

Any thoughts what could be wrong and how I can modify my current code that additionally added text would stay in description field?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Derek Fields _RightStar_
Community Champion
January 10, 2020

Make sure that your code is in the Initialization and not in the field behavior. The initialization will set the default text when the screen is first displayed. After that, it won't run. If you put it into the field behavior script, it will run every time the field is updated. 

Jovita Sajonaite
January 12, 2020

Perfect, thank you! It solved my issue :)