Options for not rendering an issue panel based on issue's state?

:wave: I’d like to not have an app’s issue panel section rendered under certain conditions (for instance, based on the status of the issue).

My digging into it has turned up two options which I’ll enumerate below. Is there a better option that I’m missing?

Returning an empty response:

I tried returning nothing in my Custom UI’s response:

import React from 'react';
import ForgeReconciler from '@forge/react';

const App = () => {

    <App />

But that continued to render the panel’s title with an empty body:

Using displayConditions

Using displayConditions achieves what I want to from a UX-perspective–a negative condition doesn’t show any panel UI/UX. However, you’re limited to the conditions as documented:
https://developer.atlassian.com/platform/forge/manifest-reference/display-conditions/jira/. I understand, based on the condition options that exist, that these are primarily intended to be used to provide the correct user experience to a user based on that user’s permissions/access. They aren’t really intended, as far as I can tell, to be used as a means for displaying an issue based on the state of the issue.

Any other options out there that I could consider?

1 Like

Hi @BentleyCook ,

Welcome to the Atlassian Developer Community :wink:

With regard to the purpose of conditions, my understanding is that they are primarily designed to be used to optimise the user’s experience which is why a lot of conditions are role/permission based, but not all. Also note that conditions are not a substitute for authorization checking. Forge has a few non role/permission based conditions such as projectKey and Connect has the is_issue_unresolved condition which implies conditions based on issue status makes sense. Connect also has the jira_expression condition which is quite powerful, but this is not available in Forge. I believe these are just capabilities yet to be added to Forge, rather than intentionally omitted. There are feature requests to close this gap such as Display Conditions using App property or Jira expression. You may like to create a new FRGE issue to capture your requirements.

In order to move forward, perhaps you can render some kind of empty state to indicate why the panel exists, but has no meaningful content to present.

Also note that I don’t believe there is any way to force the display of an IssuePanel. Regardless of display conditions, the panel will only be shown by default for a particular issue if the user previously opened the panel and left it open for that same issue. Based on this, you could consider whether an alternate extension point such as IssueContext or IssueActivity would be better for your use case.

I hope this helps.