Hi, I tried adding the a script in the 'description' of my custom field (which is a dropdown). I edited the field configuration for the custom field.
When I create an issue and change the value of the custom dropdown, I dont get to see the alert that I added. Am I missing something?
The script I used is:
<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_10300").change(function() {
showHidField();
});
}
function showHidField(){
//drop down field selected value
var dropDownFieldval = $.trim($("#customfield_10300 :selected").text());
alert(dropDownFieldval);
if(dropDownFieldval == 'MAS'){
alert('hello');
}
});
</script>