Web Item

Adds a web item to a specified location in the application interface. A web item is a hyperlink that's inserted into some standard place in the Atlassian application interface, such as the administration menu.

The form that the link takes can vary depending on the location. For instance, a web item in the header bar (with a location section of system.top.navigation.bar) adds a link to the navigation bar across the top of the interface. On the other hand, a web item in the opsbar-operation location section in Jira adds an item to the issue operation buttons.

A web item link can open a new page in the application or a dialog, depending on your configuration.

Web items are a simple and useful way to extend Atlassian applications. If you want to extend an Atlassian application and don't know where to start, a web item may be all you need.

Your add-on can receive additional context from the application by using variable tokens in the url attribute.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "modules": {
    "webItems": [
      {
        "location": "system.preset.filters",
        "weight": 200,
        "styleClasses": [
          "webitem",
          "system-present-webitem"
        ],
        "url": "/my-web-item",
        "context": "addon",
        "target": {
          "type": "page"
        },
        "tooltip": {
          "value": "Example tooltip"
        },
        "icon": {
          "width": 16,
          "height": 16,
          "url": "/maps/icon.png"
        },
        "name": {
          "value": "My Web Item"
        },
        "key": "web-item-example"
      }
    ]
  }
}

Properties

key
Type
Max length
100
Required
Yes
Pattern
^[a-zA-Z0-9-]+$
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:

1
2
3
4
5
6
7
8
9
{
    "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.


location
Type
Max length
100
Required
Yes
Description

The location in the application interface where the web item should appear. For the Atlassian application interface, a location is something like the coordinates on a map. It points to a particular drop-down menu or navigation list in the UI.

Places in the Atlassian UI are identified by what are known as "well-known locations". For example, the system.admin/globalsettings location is in the administrative menu on the left side of the Administration Console.

Find product locations with the Extension Point Finder

You can also find all Confluence locations on this page.


name
Type
Required
Yes
Description

A human readable name.

Represents a string that can be resolved via a localization properties file. You can use the same i18n Property key and value in multiple places if you like, but identical keys must have identical values.

Example

1
2
3
4
{
  "value": "My text"
}

Properties

value
Type
Max length
1500
Required
Yes
Description

The human-readable default value. This will be used if no translation exists. Only the following HTML tags are supported: b, i, strong, em, and code.

i18n
Type
Max length
300
Description

The localization key for the human-readable value. Translations for the keys are defined at the top level of the add-on descriptor.


cacheable
Type
Defaults to
false
Description

Returns whether the URL should be cacheable. Cacheable URLs are taken directly from the add-on descriptor, and lack all additional query parameters:

  • standard iframe query parameters
  • product context parameters
  • JWT token


conditions
Type
Description

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


context
Type
Defaults to
addon
Allowed values
  • page
  • PAGE
  • addon
  • ADDON
  • product
  • PRODUCT
Description

The context for the URL parameter. Not applicable if an absolute URL is specified. Possible values

  • addon - a URL relative to the add-on's base URL
  • page - targets a Page module by specifying the Page's module key as the URL
  • product - a URL relative to the product's base URL


icon
Type
Description

An optional icon to display with the link text or as the link, specified by URL to its hosted location. You can specify a particular width and height for the icon. Most link icons in Atlassian applications are 16 by 16 pixels.

Defines an icon to display.

Example

1
2
3
4
5
6
7
8
{
  "icon": {
    "width": 16,
    "height": 16,
    "url": "/my-icon.png"
  }
}

Properties

url
Type
Format
uri
Required
Yes
Description

The URL of the icon. Your icon needs to be hosted remotely at a web-accessible location. You can specify the URL as an absolute URL or relative to the add-on's base URL.

height
Type
Description

The height in pixels of the icon image.

width
Type
Description

The width in pixels of the icon image.


params
Type
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

1
2
3
4
5
6
7
{
  "params": {
    "someOtherProperty": "someValue",
    "myCustomProperty": "myValue"
  }
}

styleClasses
Type
Description

Specifies custom styles for the web item target page, if desired. By default, the web item content gets styled in the default style of the target application. It must only contain alphanumeric characters, dashes, underscores and must only start with alpha characters or underscores.


target
Type
Description

Defines the behaviour when the item is triggered. If omitted, the url behaves as a regular hyperlink.

Defines the way a web item link is opened in the browser, such as in a modal or inline dialog.

Inline Dialog Example

1
2
3
4
5
6
7
8
9
10
11
{
  "target": {
    "type": "inlinedialog",
    "options": {
      "onHover": true,
      "offsetX": "30px",
      "offsetY": "20px"
    }
  }
}

Dialog Example

1
2
3
4
5
6
7
8
9
10
{
  "target": {
    "type": "dialog",
    "options": {
      "height": "100px",
      "width": "200px"
    }
  }
}

Common Dialog Module Example

1
2
3
4
5
6
7
8
9
{
  "target": {
    "type": "dialogmodule",
    "options": {
      "key": "dialog-module-key"
    }
  }
}

More details for this use-case can be found on the Dialog Module page.

Properties

options
Type
Description

An object containing options which vary based on the type of web item target you are implementing.

Currently-allowed options are:

type
Type
Defaults to
page
Allowed values
  • page
  • PAGE
  • dialog
  • DIALOG
  • inlinedialog
  • INLINEDIALOG
  • dialogmodule
  • DIALOGMODULE
Description

Defines how the web-item content should be loaded by the page. By default, the web-item is loaded in the same page. The target can be set to open the web-item url as a modal dialog or an inline dialog.


tooltip
Type
Description

The internationalised text to be used in the link's tooltip.

Represents a string that can be resolved via a localization properties file. You can use the same i18n Property key and value in multiple places if you like, but identical keys must have identical values.

Example

1
2
3
4
{
  "value": "My text"
}

Properties

value
Type
Max length
1500
Required
Yes
Description

The human-readable default value. This will be used if no translation exists. Only the following HTML tags are supported: b, i, strong, em, and code.

i18n
Type
Max length
300
Description

The localization key for the human-readable value. Translations for the keys are defined at the top level of the add-on descriptor.


url
Type
Format
uri-template
Description

Specifies the destination of the web item. The interpretation of this field depends on the value of the

1
context

field.

This field is required if the target of the item is not a Dialog Module.

Your add-on can receive additional context from the application by using variable tokens in the URL attribute.


weight
Type
Defaults to
100
Description

Determines the order in which the web item appears in the menu or list.

The "lightest" weight (i.e., lowest number) appears first, rising relative to other items, while the "heaviest" weights sink to the bottom of the menu or list.

Built-in web items have weights that are incremented by numbers that leave room for additional items, such as by 10 or 100. Be mindful of the weight you choose for your item, so that it appears in a sensible order given existing items.


Rate this page: