Created
May 8, 2015 12:26
-
-
Save Sarapulov/b76885af1b7053b34f5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| inspired from this sources https://jqueryui.com/autocomplete/#xml | |
| */ | |
| $(function() { | |
| var mydata = []; | |
| $.ajax({ | |
| url: "{{YOUR GOOGLE WEB SERVICE URL WHICH RETURNS JSON}}", | |
| dataType: "jsonp", | |
| success: function(data) { | |
| $(data.{{ GOOGLE SHEET NAME }}).each(function() { // MAY VARY DEPENDS ON YOUR JSON OUTCOME | |
| var record = this.NAME + " - " + this.VALUE; // THIS LINE DEPENDS ON YOUR JSON OUTCOME | |
| mydata.push(record); | |
| }); | |
| $("#request_custom_fields_24212885").autocomplete({ // USE YOUR TICKET FIELD REFERENCE | |
| source: mydata, | |
| minLength: 0, | |
| select: function(event, ui) { | |
| $("#request_custom_fields_24212885").val( ui.item.value ); // THIS SHOULD SET THE VALUE ONCE YOU MADE A CHOICE | |
| } | |
| }); | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment