I have added the following Behaviour, but I also need to make sure the Fixed Deadline Date field is cleared if the Fixed Deadline is No. Would I need to add something like this to last line in else
issue.setCustomFieldValue(fxieddeadlinedateField, null)
def fixeddeadlineField = getFieldByName("Fixed Deadline")
def fixeddeadlinedateField = getFieldByName("Fixed Deadline Date")
if (fixeddeadlineField.value.toString() == "Yes") {
fixeddeadlinedateField.setRequired(true)
fixeddeadlinedateField.setHidden(false)
}
else {
fixeddeadlinedateField.setRequired(false)
fixeddeadlinedateField.setHidden(true)
}
I got this to work.
def fixeddeadlineField = getFieldByName("Fixed Deadline")
def fixeddeadlinedateField = getFieldByName("Fixed Deadline Date")
def defaultValue = null
if (fixeddeadlineField.value.toString() == "Yes") {
fixeddeadlinedateField.setRequired(true)
fixeddeadlinedateField.setHidden(false)
}
else {
fixeddeadlinedateField.setRequired(false)
fixeddeadlinedateField.setHidden(true)
fixeddeadlinedateField.setFormValue(defaultValue)
}
The documentation states that there is a 'setFieldValue("")' method -- You should be able to pass in a Blank String or a null.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When i try the following, I get the variable "issue" is undeclared
def fixeddeadlineField = getFieldByName("Fixed Deadline")
def fixeddeadlinedateField = getFieldByName("Fixed Deadline Date")
if (fixeddeadlineField.value.toString() == "Yes") {
fixeddeadlinedateField.setRequired(true)
fixeddeadlinedateField.setHidden(false)
}
else {
fixeddeadlinedateField.setRequired(false)
fixeddeadlinedateField.setHidden(true)
issue.setCustomFieldValue(fixeddeadlinedateField, null)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.