I want to sreate my own custom field plugin. I use select2 for it. But I can't include any scripts ir styles in it.
As workaround I inserted my scripts just in <script></script> tag and styles in <style></style>.
And my question is: what is correct way to do it?
E.g. in webwork I can include JS as webresource. But I don't know how to do it in custom field velocity template.
This resource is unavailable for me. But I think the problem is with aui-select2. We also tried to use this type of field with REST call and had similair problems. We decided to use simple select instead. Try to simplify your script. For example, remove rest call or choose another field type. If it works with a simplified version then you can find the real bug. It would be time consuming to try to recreate your example. It is too much complicated.
I mean that it would be time consuming for me to try to make your code work, because your code has many dependencies on your other modules. If I tried to recreate all dependencies myself, then I would spend too much time.
Also I meant that we had about the same problem with aui-select2 when we tried to call a Rest method from an aui-select2 control. I did not dig deep in that case that is why I can not say for sure that it was a bug in Atlassian libraries or a bug in a developer code. But in the end we used aui-select and the code worked for us without changes.
Ok, thank you for explanation.
I tried to change my edit.vm and I've see that template is work.
But all styles and scripts are loaded only when I click on my field then click on Edit button and close popup window:
And if I want to edit this field again I need repeat all these actions.
I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs