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

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 :)

Suggest an answer

Log in or Sign up to answer