Hello!
Having trouble setting the default form value for a custom multi-line text field when creating an issue, using scriptrunner behaviours. It works for system description field as per a scriptrunner example, but no clear way to achieve the same for a custom description field. Also total lack of information on underlyingissue class in the documentation.
def descField = getFieldById("customfield_#####")
def defaultValue = """1. Lorum Ipsum
2. random text
3. blah blah
4. Profit!
""".replaceAll(/ /, '')
if (!descField.getValue()) {
descField.setFormValue(defaultValue)
}Tried setting it to check if the custom text field is empty, but does not work, likely not knowing for where. Hence the underlyingissue class.
It would be 'if (!underlyingIssue?.description)' for a system description field, so what would be the equivalent for a custom text field?
I tried 'if (!underlyingIssue?.getFieldById("customfield_#####"))' and ' if (!underlyingIssue?.descField)' and other variations to no avail, but spits the error that it does not exist for the class.
Appreciate any help with this, or pointing towards a better method.