I have a Single Choice select list (Environment) and two check boxes (Norman Privileges and Admin Privileges). Currently I want to show Admin Privileges only if Production from Environment dropdown is selected. Otherwise it should hide that field. I am trying this script and it is not hiding the field. Could you please let me know if I am doing anything wrong here?
<script type="text/javascript">
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
callChangeFunction();
});
callChangeFunction();
function callChangeFunction() {
showHideField();
$("#customfield_12440").change(function() {
showHideField();
});
}
function showHideField() {
var environment = $.trim($("#customfield_12440 :selected").text());
$("#customfield_16144").parent().hide();
if (environment == 'Production') {
$("#customfield_16144").parent().show();
}
if (environment == 'Non-Production') {
$("#customfield_16144").parent().hide();
}
}
});
</script>