Forge Developer

Forge Developer

Rate this page:

Display conditions

Using display conditions, you can control the visibility of your app modules in the UI.

You can't rely only on display conditions as a mechanism to protect sensitive data. This is because they are executed on the client-side and it is impossible to guarantee the execution result won't be overridden using developer tools of the browser.

We strongly recommend you applying appropriate permission checks in your code on top of display conditions for any sensitive data you are going to operate with.

Operators

Display conditions supports the following logical operators:

  • and
  • or
  • not

By default, the and operator comes with multiple display conditions.

Example

In the example below, the Jira issue panel module will only be rendered on issues of a Bug type.

1
2
3
4
5
6
7
jira:issuePanel:
- key: hello-world-panel
  function: issue-panel-function
  title: Hello world!
  icon: https://developer.atlassian.com/platform/forge/images/issue-panel-icon.svg
  displayConditions:
    issueType: Bug

In the example below, the display conditions for the Jira issue panel module are slightly more complex.

1
2
3
4
5
6
7
8
9
10
11
12
jira:issuePanel:
- key: hello-world-panel
  function: issue-panel-function
  title: Hello world!
  icon: https://developer.atlassian.com/platform/forge/images/issue-panel-icon.svg
  displayConditions:
    or:
      canDeleteAllComments: true
      and:
        projectKey: TEST
        not:
          issueType: Epic

In this example, the Jira issue panel module will only be rendered if the following conditions are met:

  • the user can delete all the comments in the given issue or
  • the project key is TEST and the issue is not of the epic type

It is not recommended to rely only on display conditions. You also should perform a a permission check in your code to confirm user indeed has a permission to delete comments.

Issue view properties

Issue view properties are supported in the following modules:

Common propertiesType
isAdminboolean
isLoggedInboolean
isSiteAdminboolean
  
Jira specific propertiesType
hasSoftwareAccessboolean
hasServiceDeskAccessboolean
hasCoreAccessboolean
  
Issue view specific propertiesType
issueKeyArray<string> or string
issueIdArray<string> or string
issueTypeArray<string> or string
projectKeyArray<string> or string
projectIdArray<string> or string
projectTypeArray<string> or string
canAddCommentsboolean
canAdministerJiraboolean
canAdministerProjectsboolean
canAssignIssuesboolean
canBeAssignedToIssuesboolean
canCloneIssuesboolean
canCreateAttachmentsboolean
canCreateChildrenboolean
canCreateSubtasksboolean
canDeleteAllAttachmentsboolean
canDeleteAllCommentsboolean
canDeleteAllWorklogsboolean
canDeleteIssuesboolean
canDeleteOwnAttachmentsboolean
canDeleteOwnCommentsboolean
canDeleteOwnWorklogsboolean
canEditAllCommentsboolean
canEditAllWorklogsboolean
canEditIssuesboolean
canEditOwnCommentsboolean
canEditOwnWorklogsboolean
canLinkIssuesboolean
canLogWorkboolean
canManageWatchersboolean
canModifyReportersboolean
canMoveIssuesboolean
canScheduleIssuesboolean
canUseServiceManagementAgentFeaturesboolean
canBrowseUsersboolean
canViewDevToolsboolean
canViewWatchersboolean

Rate this page: