I am implementing a web-item and a web-panel for Jira Service Desk request view and I have managed to render the panels all fine. Additionally, I have a project property that indicates if the Service Desk request view integration is enabled or not. As a result, I have added an EntityPropertyEqualToCondition
to decide if the web-panel/item should be rendered.
In case of the web-item that works as expected. However, for the web-panel it does not. While debugging, I found that the context
passed to EntityPropertyEqualToCondition.shouldDisplay(Map<String, Object> context)
method does include the Jira project for the web-item, but not for the web-panel. If I understand that code correctly, that’s why it works in one case but not the other.
Is there any specific reason why this does not work for web-panel? Is this something Atlassian could fix?
I have the same conditions in the Cloud implementation and there it works as expected for both.
As a reference the atlassian-plugin.xml looks as follows:
...
<web-item
key="sd-portal-request-view-action-link"
i18n-name-key="sd-portal-request-view-action-link.name"
name="Action Link"
section="servicedesk.portal.request.actions"
weight="20">
<label key="sd-portal-request-view-action-link.label"/>
<link linkId="action-link">
/page/issue/dialog/link
</link>
<icon height="16" width="16">
<link>/assets/images/icon.png</link>
</icon>
<conditions type="AND">
<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
<condition class="com.atlassian.jira.plugin.webfragment.conditions.EntityPropertyEqualToCondition">
<param name="entity">project</param>
<param name="propertyKey">com.my.configuration</param>
<param name="objectName">serviceDeskRequestViewEnabled</param>
<param name="value">true</param>
</condition>
</conditions>
</web-item>
<web-panel
key="sd-portal-request-view-panel-links"
i18n-name-key="sd-portal-request-view-panel-links.name"
name="Link Panel"
location="servicedesk.portal.request.panels"
weight="100">
<resource name="view" type="velocity" location="views/panel.vm"/>
<context-provider class="com.my.RequestViewPanelContextProvider"/>
<conditions type="AND">
<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
<condition class="com.atlassian.jira.plugin.webfragment.conditions.EntityPropertyEqualToCondition">
<param name="entity">project</param>
<param name="propertyKey">com.my.configuration</param>
<param name="objectName">serviceDeskRequestViewEnabled</param>
<param name="value">true</param>
</condition>
</conditions>
</web-panel>
...