Why does EntityPropertyEqualToCondition not work consistently in JSD request view?

conditions
jira-server

#1

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>
...

#2

Actually I just found out that I reported this for Cloud before (https://ecosystem.atlassian.net/browse/JSDECO-81), but it seems this is not fixed for Server.

@msamy do you think this is something that could be tackled?


#3

I opened an issue for this here: https://ecosystem.atlassian.net/browse/JSDECO-98

Hoping to get some attention.


#4

@tbinna Thanks for opening a ticket. As an FYI, when raising a bug issue in the future I highly recommend raising it in the Developer Support desk. The benefits of this are:

  1. You don’t need to know which project to open your ticket in

  2. We can provide a quick triage of the bug to ensure it is, in fact, a bug

  3. We monitor and move the bug along with the product team

It also allows us to track all the bugs across the ecosystem to see if there are any trends that we need to provide attention on.


#5

Thanks @rwhitbeck for the suggestion, I will do that next time. Sorry, didn’t know about the Developer Support desk.