I have written below script which is working partially. I am able to hide the field but When I select Investment Stale, customfield is not becoming mandatory.
<script type="text/javascript">
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
callChangeFunction();
});
callChangeFunction();
function callChangeFunction(){
showHidField();
$("#customfield_10019").change(function() {
showHidField();
});
}
function showHidField(){
var dropDownFieldval =
$.trim($("#customfield_10019 :selected").text());
$("#customfield_10016").closest('div.field-group').hide();
if(dropDownFieldval == 'Investment Slate'){
$("#customfield_10016").closest('div.field-group').show();
$("#customfield_10016").closest('div.field-group').setRequired(true);
}
}
});
</script>
use the validator function in the work flow - where you can set a field mandatory based on the another select list field value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.