Hello, i develop plugin for jira.
I have following resources in my xml file. Can someone show example how to use it in velocity template?
Thanks!
Hello,
You should add to your velocity template something like this:
$webResourceManager.requireResourcesForContext("pluginkey:jira-plugin-resources")
You can find the plugin key of your plugin in the add-on sections, after you installed your add-on.
@Alexey Matveev looks you've mixed up requireResourcesForContext and requireResource
$webResourceManager.requireResourcesForContext takes context value as a parameter. In this case it will be "jira-plugin"
$webResourceManager.requireResource takes resource key in format "pluginkey:modulekey".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. And after how to require it in template?
I should call another function? (just a resource name doesn't work)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mikhail_Kopylov thank you. It must be
$webResourceManager.requireResources("pluginkey:jira-plugin-resources")
You do not need to add the script tag. Your script is already loaded. Try to put alert into your js file and you will see the alert pop-up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
$webResourceManager.requireResource("pluginkey:jira-plugin-resources") actually :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, it works. I became js and css files.
But how to load images?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexey,
Found this closely relevant to what I am trying to do, however slightly different.
We have a velocity template which we are calling on the click of a Custom banner button on confluence page.
We are able to render the velocity template with whatever UI we designed, however the JScript which we have defined in plugin.xml as a web resource, is not getting loaded and hence not getting applied to the velocity template.
Any idea here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.