Documentation

Single Condition

Conditions can be added to modules to display them only when all the given conditions are true.

Single Conditions can take optional parameters. These parameters will be passed in to the condition's init() method as a map of string key/value pairs before any condition checks are performed.

To invert a condition, add the attribute invert="true" to the condition element. This is useful where you want to show the section if a certain condition is not satisfied.

Single Conditions must contain a condition attribute with the name of the condition to check.

The valid condition names are as follows:

CONFLUENCE

  • active_theme
  • can_edit_space_styles
  • can_signup
  • content_has_any_permissions_set
  • create_content
  • email_address_public
  • favourite_page
  • favourite_space
  • following_target_user
  • has_attachment
  • has_blog_post
  • has_page
  • has_space
  • has_template
  • latest_version
  • not_personal_space
  • printable_version
  • showing_page_attachments
  • space_function_permission
  • space_sidebar
  • target_user_can_set_status
  • target_user_has_personal_blog
  • target_user_has_personal_space
  • threaded_comments
  • tiny_url_supported
  • user_can_create_personal_space
  • user_can_update_user_status
  • user_can_use_confluence
  • user_favouriting_target_user_personal_space
  • user_has_personal_blog
  • user_has_personal_space
  • user_is_admin
  • user_is_confluence_administrator
  • user_is_logged_in
  • user_is_sysadmin
  • user_logged_in_editable
  • user_watching_page
  • user_watching_space
  • user_watching_space_for_content_type
  • viewing_content
  • viewing_own_profile



JIRA

  • can_attach_file_to_issue
  • can_attach_screenshot_to_issue
  • can_manage_attachments
  • has_issue_permission
  • has_project_permission
  • has_selected_project
  • has_sub_tasks_available
  • has_voted_for_issue
  • is_admin_mode
  • is_issue_assigned_to_current_user
  • is_issue_editable
  • is_issue_reported_by_current_user
  • is_issue_unresolved
  • is_sub_task
  • is_watching_issue
  • linking_enabled
  • sub_tasks_enabled
  • time_tracking_enabled
  • user_has_issue_history
  • user_is_admin
  • user_is_logged_in
  • user_is_project_admin
  • user_is_sysadmin
  • user_is_the_logged_in_user
  • voting_enabled
  • watching_enabled

JIRA condition parameter mappings

The following table shows the condition parameters available for has_issue_permission and has_project_permission in Atlassian Connect module declarations and how they map to the permissions described in the Permissions class documentation.

JIRA condition parametersAtlassian Connect equivalent
ADMINISTERadmin
USEuse
SYSTEM_ADMINsysadmin
PROJECT_ADMINproject
BROWSEbrowse
CREATE_ISSUEcreate
EDIT_ISSUEedit
EDIT_ISSUEupdate
SCHEDULE_ISSUEscheduleissue
ASSIGNABLE_USERassignable
ASSIGN_ISSUEassign
RESOLVE_ISSUEresolv
CLOSE_ISSUEclose
WORKLOG_EDIT_ALLworklogeditall
WORKLOG_EDIT_OWNworklogeditown
WORKLOG_DELETE_OWNworklogdeleteown
WORKLOG_DELETE_ALLworklogdeleteall
WORK_ISSUEwork
LINK_ISSUElink
DELETE_ISSUEdelete
CREATE_SHARED_OBJECTSsharefilters
MANAGE_GROUP_FILTER_SUBSCRIPTIONSgroupsubscriptions
MOVE_ISSUEmove
SET_ISSUE_SECURITYsetsecurity
USER_PICKERpickusers
VIEW_VERSION_CONTROLviewversioncontrol
MODIFY_REPORTERmodifyreporter
VIEW_VOTERS_AND_WATCHERSviewvotersandwatchers
MANAGE_WATCHER_LISTmanagewatcherlist
BULK_CHANGEbulkchange
COMMENT_EDIT_ALLcommenteditall
COMMENT_EDIT_OWNcommenteditown
COMMENT_DELETE_OWNcommentdeleteown
COMMENT_DELETE_ALLcommentdeleteall
ATTACHMENT_DELETE_OWNattachdeleteown
ATTACHMENT_DELETE_ALLattachdeleteall
CREATE_ATTACHMENTattach
COMMENT_ISSUEcomment
VIEW_WORKFLOW_READONLYviewworkflowreadonly


Example

{
  "condition": {
    "condition": "user_is_logged_in",
    "invert": false
  }
}

Properties

condition

Type
string
Required
Yes

invert

Type
boolean
Defaults to
false

params

Type
object
Description

This object represents a map of key/value pairs, where each property name and value corresponds to the parameter name and value respectively.

Example

{
  "params": {
    "someOtherProperty": "someValue",
    "myCustomProperty": "myValue"
  }
}