Hi
I've seen a bunch of examples with slightly different requirements. But my requirement is on a transition that 5 different issue types can go down, to only check two of them for BOTH levels of a cascading field to be filled in.
For example:
If Issue type = Service Request
then
Both levels of 'Service Request Type' cascading field need to be filled in
if Issue Type = Incident
then
Both levels of 'Incident Type' cascading field need to be filled in.
and to not worry about the other 3 issue types.
I managed to fish out this example from Googling around for the cascading field requirements, but I need to know how to how to make it only check depending on the issue type
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
def issue = issue as MutableIssue
def cascadingSelect = ComponentAccessor.customFieldManager.getCustomFieldObjects(issue)?.findByName("Service Request Type")
def values = issue.getCustomFieldValue(cascadingSelect) as HashMap
// Will return true if both the parent and child options in the Cascading Select have a value
values?.keySet()?.size() == 2