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

Vineet Kumar April 18, 2013

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
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.
April 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

0 votes
Mizan
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.
April 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

0 votes
Chaithra N
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.
April 18, 2013

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

Suggest an answer

Log in or Sign up to answer