Documentation

Keyboard Shortcut

This module type adds the ability for an add-on to declare keyboard shortcuts. Currently only available for JIRA.

A Connect keyboard shortcut can perform one of three actions: navigate to a page, open a dialog module, or invoke an action represented by a web-item on a page. Pages, dialog modules and web-items referenced by the shortcut must be declared by the same add-on.

A shortcut is identified by a sequence of letters which need to be pressed in order for the shortcut action to be invoked. You cannot declare shortcuts that would shadow shortcuts defined by the product. A shortcut shadows all shortcuts which start with its sequence.

On the other hand, it's possible to shadow shortcuts defined by the same or other add-ons, although those won't be accessible anymore.

In case multiple shortcuts have the same sequence, there is no guarantee on which will be invoked.

Example

{
  "modules": {
    "keyboardShortcuts": [
      {
        "shortcut": "gmm",
        "target": {
          "key": "page-key"
        },
        "context": "global",
        "name": {
          "value": "My keyboard shortcut"
        },
        "key": "keyboard-shortcut-key"
      }
    ]
  }
}

Properties

key

Type
string
Required
Yes
Description

A key to identify this module.

This key must be unique relative to the add on, with the exception of Confluence macros: Their keys need to be globally unique.

Keys must only contain alphanumeric characters and dashes.

The key is used to generate the url to your add-on's module. The url is generated as a combination of your add-on key and module key. For example, an add-on which looks like:

{
    "key": "my-addon",
    "modules": {
        "configurePage": {
            "key": "configure-me",
        }
    }
}

Will have a configuration page module with a URL of /plugins/servlet/ac/my-addon/configure-me.

name

Required
Yes
Description

A human readable name.

shortcut

Type
string
Required
Yes
Description

The shortcut sequence. The current limitations are

  • the sequence cannot shadow an existing product shortcut
  • can only contain lowercase letters
  • has to be shorter than 4 characters

target

Required
Yes
Description

The target must be the key of another module defined by the add-on.

Below are the actions which will be executed by the shortcut depending on the module type of the target.

  • General Page: Navigates to the general page
  • Dialog: Opens the dialog
  • Web Item: Emulates clicking on the web item, which must be present on the current page

context

Type
string
Allowed values
  • global
  • GLOBAL
  • issue_navigation
  • ISSUE_NAVIGATION
  • issue_action
  • ISSUE_ACTION
  • agile_board
  • AGILE_BOARD
  • Description

    The context in which the shortcut will be available. This is optional, if not given the shortcut is assumed to be global. Different products define different contexts.

    JIRA supported contexts:

    • global
    • issue_navigation
    • issue_action
    • agile_board