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);
}
}
}
}
Hi @nihcet
If you want this behaviour to be applied only to specific transition, then you can choose it from the conditions of the chosen field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.