Hello Team,
We are using behavior in one of our Jira project for Bug Issue type. We are using a script in the Description field to get predefined data.
After creating the issue whenever we are trying to edit an existing issue, the description gets reset to the default text and all user filled in the text is deleted.
I am attaching my script here. Please suggest.
def desc = getFieldById("description")
def issueType = getFieldById("issuetype")
def issueTypeVal = issueContext.issueType.name
if (issueTypeVal == "Bug") {
def defaultValue = """*<Description>*
*Steps to reproduce:*
*1.*
*2.*
*3.*
*Actual result:*
*Expected result:*""".replaceAll(/ /, '')
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
} else {
desc.setFormValue(" ")
}