I have created a Customfield plugin, which uses the AUI template system (https://docs.atlassian.com/aui/5.7.0/docs/template.html) in the View.vm file.
When the issue is opened in a new window, everything is loaded as expected, however when the issue is selected in the 'Issues > Search for issues' window, the templates are not loaded, hence causing Javascript to fail to find the templates.