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 edited

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
TAGS
Atlassian, Team '25 Europe, Atlassian conference, AI-powered teamwork, Atlassian events, keynote speakers, Barcelona tech conference, Atlassian Williams Racing, Carlos Sainz, Jenson Button, Mike Cannon-Brookes, Anu Bharadwaj, Atlassian Rovo

Atlassian Williams Racing is coming to Team '25 Europe 🏎️

Discover the teamwork and precision behind success on and off the track. See how this high-performing team makes the impossible possible. Be one of the first 100 customers to register for a chance to win 2 tickets to an Atlassian Williams 2026 race.

Register now
AUG Leaders

Atlassian Community Events