Forums

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

Default Description in Multiline Text Field

Administrator September 28, 2021

Hello all,

I have created a Behaviour Script for a Multi Line Text Field with a default value that can be edited afterwards. 

def contentBriefing = getFieldById("customfield_XYZ")
def defaultvalue ="""TEXT

TEXT

TEXT""

if (!underlyingIssue?.description) {
contentBriefing.setFormValue(defaultvalue)
}

But now comes the request: if you have edited the value once (e.g. during ticket creation), saved it and then edit the field again, then the entries should be preserved (the default value should not be displayed again). How can I realize this?

 

Thanks

2 answers

1 accepted

0 votes
Answer accepted
Marco Brundel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2021

Hi @Administrator 

I have set up a few behaviours at a customer where the Description field is filled with a template on the create screen. If this is adjusted/added, this will not be overwritten by the behaviour later during an edit.

Sample script:

def desc = getFieldById("description")

def defaultValue = """\

*Impact*:

*Testplan*:

*Roll Back*:

*Contact*:

*Actions*:

""".stripIndent()

if (!desc.formValue) {
desc.setFormValue(defaultValue)
}



Regards, Marco 

Administrator November 15, 2021

Thx, Marco. Your answer was very helpful for me.

Like Marco Brundel likes this
alo saya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 22, 2022

marco

0 votes
alo saya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 22, 2022

formate

Suggest an answer

Log in or Sign up to answer