Hi,
When opening a issue with a scriptrunner behavior, I add template text to the description field and after modify it. But if I click "Create" without adding it to a required field, it applies the template again.
How do I prevent the template from applying even if the required field is forgotten?
import com.onresolve.jira.groovy.user.FormField
FormField descField = getFieldById("description")
// Custom Field'de seçeneğini giriniz.
def prt = "PRT"
// Aşağıdaki alana description alanında görünmesini istediğiniz şablonu giriniz.
def temp = """
Template text.
Template text.
Template text.
Template text.
"""
def cf = getFieldById(getFieldChanged())
if (null != cf) {
String[] values = (String[])cf.getValue();
if (getActionName() != "Create Issue") {
if (values.length == 2) {
if (values[1] == prt) {
if (! underlyingIssue?.description)
descField.setFormValue(temp);
}
}
}
}