Hi,
I created a behaviour that put a template in the description of a specific issue type.
When I change inside the create screen from one type to another, the template is still there.
so I created another behaviour that cleans the template.
Now, if I wrote somthing in the template of the description, and before saving it press on other field, all of the data I wrote disapeared...
First behaviour (only on this issue type): (description in the selected field)
import com.atlassian.jira.component.ComponentAccessor
def desc = getFieldById("description")
def defaultValue = """h5.*+General OS / DB / Browser / Machine Information:+*
h3.\n\n*+Scenario Description and steps to recreate the problem:+*
h3.\n\n*+Actual & Expected Results+*
h3.\n\n*+Log file information:+*
h3.\n\n*+Additional info:+*
h3.\n\n""".replaceAll(/ /, '')
if (! underlyingIssue?.description)
{
desc.setFormValue(defaultValue)
}
else
{
desc.setFormValue("")
}
second behaviour:
if (getAction()?.id != 1) {
return; // not the initial action, so don't set default values
}
def desc = getFieldById("description")
if(desc==null)
{
desc.setFormValue("")
}
else
{
return
}
How can I make that need?
Daniel