Hello, I am working on a plugin that displays a panel for a specific project.
This panel and these resources (Javascript) should only apply in this project.
For the panel I have no problem, using a display condition it works.
On the other hand javascript should only be applied in this context, because it hides certain elements of the view of the request.
I tried to add a context for my resources
<web-resource key="dcp-view-resources" name="dcp-view-screen">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="dcp.js" location="/js/dcp.js"/>
<context>jira.view.issue</context>
<context>jira.navigator.advanced</context>
<context>jira.navigator.simple</context>
<context>dcp.view.context</context>
</web-resource>
and load them into my veloticy template with
$webResourceManager.requireResourcesForContext ("dcp.view.context")
But it does not work
Moreover if I do not add
<context> jira.view.issue </context>
<context> jira.navigator.advanced </context>
<context> jira.navigator.simple </context>
for my resources, the resources are not displayed on all possible cases of access to a request (search, queue, direct access)
I tried to add a condition tag in my resources and to make my java inherit from “Condition” but in the “shouldDisplay ()” the context is empty.
public boolean shouldDisplay(Map<String, Object> map) {
LOG.warn(map) // empty
return false;
}
Currently I have found a workaround via javascript by getting the project key from the url and conditioning my javascript on the project key, but it is not maintainable.
So my question is:
Is it possible to condition the loading of resources on a project?
Thanks for your help