Hi,
we use the follwing code in the description (field configuration) of a text field to show or hide the field depending on a certain selection in another field (combobox):
<script type="text/javascript"> affBuild = document.getElementById('customfield_10120'); if (affBuild) { affSpecBuild = document.getElementById('customfield_10321'); affSpecBuildParent = affSpecBuild.parentNode; if (affBuild.value != '10312') { affSpecBuildParent.style.display ='none'; affSpecBuild.value = ''; } affBuild.onchange=function() { if (this.value == '10312') { affSpecBuildParent.style.display = ''; } else { affSpecBuildParent.style.display ='none'; affSpecBuild.value = ''; } } } </script>
With JIRA 5.X it is possible to switch the issue type in the "create issue" screen. After the switch was performed the script is no longer working (is not even called anymore as I have checked by setting "alert()" to the hide/show cases) and the field is always shown.
Do you know a way to keep the code functional after such a switch?
Community moderators have prevented the ability to post new answers.
Hi, in JIRA 5.x, you need to do something like:
<script type="text/javascript"> function task() { } task(); JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) { task(); }); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.