I am having trouble wrapping my head around this. The ITSM Request screen is made BEFORE an issue exists. So I think when I am calling field values, they are always showing as null. Is this even possible?
I have tried many different things. But currently I am trying to make a behavior and this is more or less what I am trying. If I run this as an initializer, it ALWAYS hides the Description field. I believe this is because the getFieldByID doesnt exist yet on the ITSM request screen?
(Sorry for the lack of a code block, not sure how to do that here)
def selectListField = getFieldById("Exception Template")
def selectListValue = selectListField.value
def textField = getFieldByName("Description")
if (selectListValue == null) {
textField.setHidden(true)
} else {
textField.setHidden(false)
}
Hoping someone can help guide me!
Figured it out! I needed the customfield nameID, not it's full name. This has some parts added as I changed the functionality from show/head to readonly true/false
def selectListField = getFieldById("customfield_12900")
def selectListValue = selectListField.value
def textField = getFieldByName("Description")
def text = "PreMade Text"
if (selectListValue == "Specific Selector Text Here") {
textField.setFormValue(text)
textField.setReadOnly(true)
} else {
textField.setHidden(false)
textField.setReadOnly(false)
textField.setFormValue(" ")
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.