I am working in a custom field that I am adding to an add-on. I have been following this guide: https://developer.atlassian.com/server/jira/platform/creating-a-custom-field-type/
The js should only load in the edit screen. I have written this in the edit.vm of my custom field:
But it is not working in Jira 7.13 when editing the field inline (by clicking the edit icon in the view screen). If I explore the html I can see that there is nothing where the js should be. But if I open the edit issue screen the script loads works. It is not present in the html but I think it loads separatedly.
My question is what is the sanctioned and correct way to add custom js to my new custom field?