Good day,
I wonder if any of you have managed to hide a "custom" checklist with prepopulated values from the view/edit screens.
It seems that if your checklist is prepopulated it is always visible?
What I want if I select Sev 1 / 2 in Priority show my checklist otherwise hide it. It works for other custom fields but but checklist.
If that is not possible is it possible to "set values" for a "blank checklist" field when creating an issue - what I then can do is to say when I create a Sev 1/2 populate checklist with option 1 and 2
Code that works to hide other "select list" custom field:
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.issue.IssueConstantImpl
def priority = getFieldById(getFieldChanged())
def fieldValue = ((IssueConstantImpl) priority.getValue()).getId()
FormField rootcause = getFieldById ("customfield_10303")
if (fieldValue == "2") {
rootcause.setFormValue(-1)
rootcause.setHidden(false)
}
else if (fieldValue == "10101") {
rootcause.setFormValue(-1)
rootcause.setHidden(false)
}
else {
rootcause.setFormValue(-1)
rootcause.setHidden(true)
}
Thank you
Marius