Here is an example of some Javascript that works well in JIRA 4.x but no longer works in 5.x when you create issues due to the changes in way the create (type/project) changing works. The Javascript seems to work UNTIL you change the project or type then it no longer appers to fire. Its strange because it will work if you don't change the project/type or if you open the "Create" window in a new tab but not if the default sub-window is used (with the project/type change at the top).
EXAMPLE of an onchange javascript hook that no longer words in JIRA 5.0
<script type="text/javascript" charset="utf-8" id="setCandidateRelnote"> document.getElementById("customfield_10403").onchange = function() { if ( document.getElementById("customfield_10403").selectedIndex == 2 || document.getElementById("customfield_10403").selectedIndex == 3 || document.getElementById("customfield_10403").selectedIndex == 5 || document.getElementById("customfield_10403").selectedIndex == 6) { document.getElementById("customfield_10306-1").checked = true; } } </script>
Same as the other question, answer is in https://developer.atlassian.com/display/JIRADEV/Custom+Fields+that+use+CSS+or+JavaScript+Web+Resources+in+JIRA+5.0.
Use a live() handler for "change" or bind to JIRA.Events.NEW_CONTENT_ADDED.
Thanks. I found that page after some more searching. Seems like I have a bit of work to do :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.