Hi,
I am having trouble reliably having JavaScript run once a ticket page has loaded. The JS is in the "Edit Announcement Banner" and runs fine on a normal ticket using $(window).load(function() for when a page loads but this seems to only work for where you open an individual ticket. JIRA doesn't seem to load a new page as such when using the JIRA queues or the JIRA search functions. I used event listeners - myElement.addEventListener('DOMSubtreeModified', thisFunction, false); on various elements - document.getElementById('stalker'), document.getElementById("sd-page-panel"), etc. but these only appear in some circumstances. I tried elements like document.getElementById("content") and even document.querySelector(".aui-group.split-view") but they were not reliable or would fire 50 times while a page was "loading" and it was unreliable and messy.
Does anyone have a reliable way to have your custom JS code run on *any and all* JIRA Service Desk ticket view methods (queues, search, individual ticket etc.) once the ticket (page) has *loaded*. I am doing some custom JS mods to the view so the page(ticket) has to fully load first before this will work. I thought I was very clever with some cool little JS and then found it only ran 1/3 of the time no matter what I did. Doh.
Any advice appreciated. 
Cheers,
Glenn