We are using JavaScript to further customize the fields in JIRA 5.0. The JavaScript is placed in the descriptions of fields on the screen we wish to modify. Some of the customizations include disabling certain fields based on the value of a field, querying options for a select list from an external database, and automatically filling in a text field based on the values of other fields.
We have come across one major blocker and I was wondering if anyone knew of a work around. Basically when you are in the Create screen and switch between issue types or projects not only is the JavaScript for the new issue type not loaded but if you go back to the original issue type that JavaScript is no longer working either. Is there anyway to ensure that the JavaScript is loaded when you switch between issue types?
Any help would be gratefully appreciated.
Community moderators have prevented the ability to post new answers.
I had the same problem once. That's how I solved it:
<script type="text/javascript"> jQuery(document).ready(function($) { functionXYZ(); JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { functionXYZ(); }); }); /*Your code*/ function functionXYZ() { if .... } </script>
the code has to be written like Harry told you. But in my case was not having the behaviour I wanted, so I removed the code from the "description" of my field and put it in the "announcement banner" in the "user interface". You can also try it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, refer to https://answers.atlassian.com/questions/79201/jira-5-1-2-questions-re-pop-up-issue-edit-window?page=1#80503. It sounds like you are facing an issue with the way Javascript is now handled in JIRA 5.x.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.