Multi Level Cascade Select field is not officially supported by Adaptavist Script Runner plugin and its component. In case of a Script Runner Behaviour though, it is possible to apply a workaround that will allow to evaluate MLCS values using Behaviours even if the field is not supported.
Here below, we're going to see how to hide fields depending on the value selected of the first level of your MLCS field. The main idea is to trigger, via script, a "change" event on a field supported by Behaviours and to create then a Behaviour that handles everything we want to accomplish.
1) For our purposes, let's define two fields: one is a Multi Level Cascade Select field called "Department" and has an ID of 10100 and the second one is a text field called "Employee" and has an ID of 11300. While changing the first level of the Department field, other fields on the screen must be hidden or displayed.
2) On the form (create / edit / transition screen) you'd like your Behaviour to be ran, choose one of the fields available and in the its own Field Configuration (related to the Project and Issue Type desired) add this javascript
<script type="text/javascript"> jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { AJS.$(function () { //get first-level item of your mlcs field var mlcs = document.getElementById("customfield_10100:0"); mlcs.onchange=function() { //when the first-level item changes, trigger a change on another custom field AJS.$("#customfield_11300").trigger("change"); } }); }); }); </script>
//hide fields available for every Department selection getFieldByName("Department 1 On-call team").setHidden(true); getFieldByName("Department 2 On-call team").setHidden(true); getFieldByName("Department 3 On-call team").setHidden(true); //access to first-level MLCS value FormField mlcs = getFieldById("customfield_11000:0"); String mlcsVal = mlcs.getValue(); log.debug("Department's First-Level value is " + mlcsVal); //test value selected using optionId and then show desired the field if("14100".equals(mlcsVal)){ getFieldByName("Department 1 On-call team").setHidden(false); } else if("14101".equals(mlcsVal)){ getFieldByName("Department 2 On-call team").setHidden(false); } else if("14102".equals(mlcsVal)){ getFieldByName("Department 3 On-call team").setHidden(false); }