Hi,
I would like to know if there is the possibilit to show/hide a custom field depending on the selection of an Insight Object.
I have used the below code which it meant to work for 2 custom fields but it doesn't apply with an Insight Object
def resolutionField = getFieldById("customfield_11122")
def fixVersionsField = getFieldById("customfield_11127")
if ("customfield_11122" == "Order (ITSM-19529)") {
fixVersionsField.setRequired(true)
fixVersionsField.setHidden(false)
}
else {
fixVersionsField.setRequired(false)
fixVersionsField.setHidden(true)
}
Any help will be appreciated.
Thanks
Finally I've managed to get it working.
It seems the selectable option from the Insight Object should be only the number and not the name neither the name and number altogether. And probably to convert the option to String too
def resolutionField = getFieldByName('resolution')
def fixVersionsField = getFieldByName('fixVersions ')
fixVersionsField.setHidden(true)
def resolutionOption = resolutionField.getValue()
if (resolutionOption.toString() == 'ITSM-19529') {
fixVersionsField.setRequired(true)
fixVersionsField.setHidden(false)
} else {
fixVersionsField.setRequired(false)
fixVersionsField.setHidden(true)
}
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.