Reload all javascript after changing Request type?

huangbe April 30, 2014

Been busy created custom fields and screen within JIRA. Have been using javascript to hide certain fields, and also bolded up some header text.

But after all this hard work, I'm noticing when Creating Issue > changing request type, none of my javascript formatting shows up anymore. Only after I do a page refresh (F5), then my JIRA screen looks the way I want it to.

This indicates to me when I do change the request type, then JIRA doesn't actually load up the field description again. Instead it just gives the generic screen layout.

Is there a way to force JIRA to reload all javascript after changing request type?

I'm assuming it needs to capture the event (mouse click on Request type?), then force a reload of the create issue page. But how? Any ideas?

Thanks in advance.

2 answers

2 votes
huangbe May 15, 2014

Found my answer, and it's nothing as complicated like creating my own plugin.

Answer is from here:

https://answers.atlassian.com/questions/160233/javascript-files-are-not-loading-on-the-pop-screen-of-jira-5-1

<script type="text/javascript">
AJS.$(document).bind('dialogContentReady', function(event, dialog) {
<!-- your script here -->
});
</script>

works for me. After changing the project or issue type, it recognised the event, and loads the Javascript again.

Now I can change and select any issue type within losing my fonts :)

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2016

thank you so much smile

0 votes
Nitram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2014

Hi,

Js wont work for the first time when you change the issue type, and it will work from the second time and if you need to make it work from first time, you need to create a plugin and you need to install it in jira, then it will work from the first time.

Check this link

https://answers.atlassian.com/questions/47843/strange-javascript-problem-in-create-screen

If you have doubts, check the answer, if you don't know how to create a plugin, jus google it up for creating atlassian plugins,

Hope this helps!

Suggest an answer

Log in or Sign up to answer