Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JQuery version on JIRA 4.4.3

Luca Andreatta
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.
February 20, 2012

What is the version of JQuery in JIRA 4.4.3?

I added a custom subset from JQuery UI 1.8.7 to add autocomplete to a custom field which works, but the others JIRA javascript actions doesn't work anymore, could anyone help me?

The vm is roughly this:

<input id="$customField.id" name="$customField.id" type="text" />

 <script type="text/javascript"><!--
    jQuery(function() {

        jQuery( "#$customField.id" ).autocomplete({
            source: function( request, response ) {
                jQuery.ajax({
                    url: "http://ws.geonames.org/searchJSON?name_startsWith=CALI&maxRows=5",
                    dataType: "jsonp",
                    success: function( data ) {
                        response( jQuery.map( data, function( item ) {
                            return {
                                label: "test label",
                                value: "test value"
                            }
                        }));
                    }
                });
            },
            minLength: 2
        });
    });
    //--></script>

The examples comes from the JQuery ufficial autocomplete plugin: http://jqueryui.com/demos/autocomplete/#remote-jsonp

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Luca Andreatta
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.
February 21, 2012

I finally found what JIRA use as javascript framework!

JIRA 4.4.3 uses Atlassian AUI 3.4.2 which uses JQuery 1.5.2 and JQuery UI 1.8.11.

In JQuery UI there are already:

  • jQuery UI Core 1.8.11
  • jQuery UI Widget 1.8.11
  • jQuery UI Mouse 1.8.11
  • jQuery UI Draggable 1.8.11
  • jQuery UI Sortable 1.8.11


To make JQuery Autocomplete work I added only:

  • jQuery UI Position 1.8.11
  • jQuery UI Autocomplete 1.8.11


In Firefox the autocomplete field works, but the other JIRA JS action doesn't and I get this error:
jQuery("form").handleAccessKeys is not a function
.../jira/s/it_IT-16bxfw/663/14/1/_/download/superbatch/js/batch.js
Line 298

In IE and Chrome everything works.

Luca Andreatta
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.
February 21, 2012

OK, I finally solved!!

The JQuery library used are correct, the problem was in Firefox that had cached the wrong version of JQuery!! Solved forcing the reload of the cache with CTRL+F5.

TomasZ June 26, 2012

How did you add jQuery UI Autocomplete ??

(I'm developing in SpeakEasy)

Luca Andreatta
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.
June 26, 2012

What do you need to know?

I used the JIRA JDK to develope a custom field plugin with the autocomplete and there is all in the question and my answers, do you need other info?

Toni Mofardin August 20, 2012

How did you find out which jQuery UI components are included in your version of Jira?

And how can I add new ones? I don't develope any plugin, I would just like to insert JavaScript code (in header.jsp for example) and use jquery autocomplete.

1 vote
Andy Brook [Plugin People]
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.
February 20, 2012

You should be using AJS.$ I think rather than jQuery, https://developer.atlassian.com/display/AUI/Getting+Started+with+AUI

If things dont work, start with a raw html page, firebug and alert('i got here') will help narrow down the problem.

Jared Farrish March 23, 2012

I learned this point (using AJS.$ in the global scope) the hard way; I would refrain from using jQuery() or $() in the global scope, although you should be able to do:

AJS.$(document).ready(function($){
    $('#mySelector').doStuff();
});

Or:

AJS.$(document).ready(function(jQuery){
    jQuery('#mySelector').doStuff();
});

See Aliasing the jQuery Namespace on the jQuery docs. Anybody doing this, though, should probably have a decent grasp of closure scope in Javascript.

Also, and this is just my own preference, console.log() is preferable to alert() for debugging while in the browser (with a browser that has console support, ie, Firebug, Chrome, and IE9, although IE's version isn't as good as the others; not sure about Safari).

TAGS
AUG Leaders

Atlassian Community Events