Javascript files are not loading on the Pop screen of Jira 5.1

Hi, we have Upgraded our jira from 4.3 to 5.1. But the Javascript files, which we had created for Jira 4.3 are not loading in the pop screen provided by Jira 5.1. is there any way to do that? As for now we have disabled the Pop up. But now we have to load some of them in workflow screen which is a absolute pop up.

3 answers

1 vote
Henning Tietgens Community Champion Apr 18, 2013

You have to surround your js with something like this

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

This works for simple scripts within the field description, like changing some layouts etc. I've not tested this with complexer ones.

For a script within the announcement banner we use this

<script type='text/javascript'>
AJS.$(document).ready(function() {
    </script><!-- your script here -->
});

Here is some background info: https://developer.atlassian.com/display/JIRADEV/Custom+Fields+that+use+CSS+or+JavaScript+Web+Resources+in+JIRA+5.0

Henning

hi,

We had also faced similar problem but it was only in the pop screen of "Create", so we had disabled the same using Java script in Announcement.

But in the worrkflow pop up screen, there was no problem.

Regards,

Chaithra

0 vote
Mizan Community Champion Apr 18, 2013

Hi Vineet , are you sure the javascript is compatible with JIRA 5.1 ?

You will need to use tools like firebug to check if your script is throwing errors . If the script is compatible you might need to add some delay in the script execution. I was facing a similar issue which i got sorted out by using the setTimeout() . I added a delay of 2 sec and the script worked on the popup/modal window

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

633 views 6 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you