what should i do, to add auto complete to any of my custom field. Any idea..?
I cannot see even auto complete renderer in drop down in field configuration drip down where we have
1. Default text renderer and
2. Wiki Type renderer
Please suggest.
Hi, this isn't currently available. You cannot select it for custom fields. What type of custom field are you trying to create? A select list?
You can inject some javascript in the description to get this to work for select/multi-select fields.
I have two scenarios:
1. I already have custom field which iis of type JIRA Multiple Database Field (Can query a database and list the results for selection in an issue) and now i need to change it to auto complete
2. I want to create a fresh custom field, so how can i make it "auto-complete" simlar to what we have in "components" field in JIRA.
My sole motive is to creata "auto-complete" custom field..!! so if you can tell me any possible way or scenario through which i can implement it . I will be more th a happy.
I hope i am clear to you..
Thanks
Here is the code we used to get multi-select lists working to look like the new autocomplete renderer:
<script type="text/javascript"> (function($) { AJS.$("#customfield_<id> option[value='-1']").remove(); //Removes the default value "None" function convertMulti(id){ if (AJS.$('#'+id+"-textarea").length == 0){ new AJS.MultiSelect({ element: $("#"+id), itemAttrDisplayed: "label", errorMessage: AJS.params.multiselectComponentsError }); } } AJS.toInit(function(){ convertMulti("customfield_<id>"); }) JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { AJS.$("#customfield_<id> option[value='-1']").remove(); convertMulti("customfield_<id>"); }); })(AJS.$); </script>
It goes in the description field in the field configuration of a customfield. Replace the customfield id with your own one. I won't take credit for this. We found this post by another user earlier.
Still not able to figure out..
can you please have a look at attached screenshots..
where i am missing .??
it would be really greatful.
Hi,
Take a look at https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.databasecf
It provides the autocomplete functionality out of the box.
Successfully used this as field description Provides "None" value, which disappears when selecting any (or multiple) other value(s), and re-appears when removing all previously select values Can be used multiple times in a single page (multiple multi-select fields with same script as description) Single issue found : if you are on the [jira-instance]/secure/CreateIssue.jspa page AND if you click "Create issue" on top right of the screen, the concerned fields just become non-working fields.
<script type="text/javascript">
jQuery(document).ready(function(){ console.log('Loaded'); jQuery.getScript('http://cdnjs.cloudflare.com/ajax/libs/chosen/0.9.12/chosen.jquery.min.js', function(data, textStatus, jqxhr) { jQuery("select[id^='customfield'][multiple='multiple'] option[value=-1]").html('Aucun'); // replace Label for "None" when necessary jQuery("select[id^='customfield'][multiple='multiple']").data('chosen', null); jQuery("select[id^='customfield'][multiple='multiple']") .chosen({no_results_text: "Aucun résultat : ", placeholder_text_multiple: " ", single_backstroke_delete: true}) .change(function() {if (jQuery(this).val()!=null) { if(jQuery(this).val().length>1 && jQuery(this).val()[0] == '-1'){jQuery('#'+jQuery(this).attr("id")+' option[value=-1]').removeAttr("selected").trigger("liszt:updated");}} else{jQuery('#'+jQuery(this).attr("id")+' option[value=-1]').attr("selected", "selected").trigger("liszt:updated"); } }); }); if(jQuery("body").size()>0){if (document.createStyleSheet){document.createStyleSheet('http://cdnjs.cloudflare.com/ajax/libs/chosen/0.9.12/chosen.css');} else {jQuery("head").append(jQuery("<link rel='stylesheet' href='http://cdnjs.cloudflare.com/ajax/libs/chosen/0.9.12/chosen.css' type='text/css' media='screen' />"));}} }); </script>
Successfully used this as field description
Provides "None" value, which disappears when selecting any (or multiple) other value(s), and re-appears when removing all previously select values
Can be used multiple times in a single page (multiple multi-select fields with same script as description)
Single issue found :
if you are on the [jira-instance]/secure/CreateIssue.jspa page AND if you click "Create issue" on top right of the screen, the concerned fields just become non-working fields.
@Harry Chan, your comment was very useful indeed . Thanks
THank s guys, although was not able to figure out exact answer but management has chnaged the requirement.
So now I do not need it as of now..!! But wil definitely post its answer very soon as I am digging things here and there only. Forget to close it before. Apologies for that
Thanks for the efforts and suggestions . It made me true fan for atlassian answers club.
hi all,
i am trying to use the same script to work for me. I copied the same script above and pasted in the field description box. and replaced custom_<id> with my own custom_field id. But it is not working after re-indexing. please help.
It looks like you're new here. Sign in or register to get started.