Web-resource condition is not working on JIRA 7.3.1

Hello,

As https://developer.atlassian.com/docs/getting-started/plugin-modules/web-resource-plugin-module says, web-resource supports the condition element, but the shouldDisplay method of my Condition is never called.

My WR definition:

<web-resource name="My conditional resource" key="plugins-conditional-resource">
    	<resource type="download" name="conditional.js" location="/js/conditional.js" />
    	
    	<condition class="com.example.DisableResourceCondition" ></condition>
    	<context>com.example.general</context>
</web-resource>

Any idea?

Thanks,
David

I think that’s pretty much up to each product to support. To be honest I don’t think I know of any that does (it’s easier just to send down all of the content).

Now one thing you can do is to create a context(which you do) and then in your servlet/action/web-panel do the condition there. But to be honest unless you’ve got super secret sensitive javascript code with people’s data you might just want to send it down all the time for your specific context. It will be much friendlier to the end user (they don’t get different javascript urls) and a lot easier to debug.