Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript in Custom Field doesnt work on Pop Up screen

Harish Tuccapuram
Contributor
September 19, 2018

Hi 

i have added the below code under description the behavior is as expected on create page.

 

<script type="text/javascript">
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
callChangeFunction();
});
callChangeFunction();
function callChangeFunction(){
showHidField();
// dropdown custom field change function
$("#customfield_18600").change(function() {
showHidField();
});

}
function showHidField(){
//drop down field selected value
var dropDownFieldval = $.trim($("#customfield_18600 :selected").text());
// $("#customfield_14682").closest('div.field-group').hide();


if(dropDownFieldval == 'QA'){
$("#customfield_14118").closest('div.field-group').show();
$("#customfield_18601").closest('div.field-group').show();
$("#customfield_16800").closest('div.field-group').hide();

if(dropDownFieldval == 'Dev'){
$("#customfield_14118").closest('div.field-group').show();
$("#customfield_18601").closest('div.field-group').hide();
$("#customfield_16800").closest('div.field-group').hide();
}

}if(dropDownFieldval == 'Production'){
$("#customfield_16800").closest('div.field-group').show();
$("#customfield_18601").closest('div.field-group').hide();
$("#customfield_14118").closest('div.field-group').hide();
}

}
});
</script>

 

however when user creates the issue on Jira-dialog-open popup it doesn't  flip the custom fields based on the selection.

 Capture.PNG

can you please suggest what i'm i doing wrong here?

 

0 answers

Suggest an answer

Log in or Sign up to answer