I'm trying to make a custom field plugin for Jira service desk, in the edit.vm file i m using an input text and the script for auiSelect2() with ajax call ,all work fine the problem is when i select an option and confirm and when i go back to my custom field again (that have an already selected option) , the input doesn't look like an aui Select field it just a simple input text with a value equals to the id of the selected option.
Hi @TARYOUS Saad!
I'm not sure if you managed to solve your problem yet, but I have a theory as to why your field isn't working.
I created a codepen to demonstrate my understanding of your problem, as well as what I believe the fix to be: https://codepen.io/chrisdarroch/pen/OZQNXy
As shown in that codepen, I believe your problem is that the HTML for the select field is being completely destroyed, then reconstructed again later. That itself isn't a problem, provided that you call `$element.auiSelect2()` again once the HTML is reconstructed. I suspect your plugin code is only calling `auiSelect2()` on the element one time at page load, which is why it doesn't work again later.
In your plugin code, you will want to listen for specific inline edit events. Check this documentation for the most up-to-date info, and some examples of how to listen for the appropriate event: https://developer.atlassian.com/server/jira/platform/extending-inline-edit-for-jira-plugins/
Hope that helps!
Daz
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.