Documentation

Macro Input Parameter

Describes a parameter input field for a macro.

Any declared parameters must also be included in the URL value of the macro in order to serialise this value. For example, for a macro with a parameter view it should be added to the macro url as follows:

 "dynamicContentMacros": [{
     ...
     "url": "/render-map?pageTitle={page.title}&viewChoice={view}",
     ...
 }]

Example

{
  "parameters": [
    {
      "identifier": "view",
      "name": {
        "value": "Map View"
      },
      "description": {
        "value": "Allows switching between view types"
      },
      "type": "enum",
      "required": true,
      "multiple": false,
      "defaultValue": "Map",
      "values": [
        "Map",
        "Satellite"
      ]
    }
  ]
}

Properties

name

Required
Yes
Description

The human readable name of the parameter which will be displayed in the UI.

identifier

Type
string

[-_a-z0-9\.]+
Required
Yes
Description

A unique identifier for the parameter. It has to be all lowercase, and must not contain any spaces. This identifier will be used in the query parameters of the add-on URL.

type

Type
string
Required
Yes
Description

The type of parameter.

Currently the following parameter types are supported in the macro browser's UI:

  • attachment: displays an autocomplete field for search on attachment filenames.
  • boolean: displays a check box.
  • confluence-content: displays an autocomplete field for search on page and blog titles.
  • enum: displays a select field.
  • spacekey: displays an autocomplete field for search on space names.
  • string: displays an input field (this is the default if unknown type).
  • username: displays an autocomplete field for search on username and full name.

aliases

Type
string, … ]
Description

Aliases for the macro parameter.

defaultValue

Type
string
Description

The default value for the parameter.

description

Description

The description of the parameter

multiple

Type
boolean
Defaults to
false
Description

Whether it takes multiple values.

required

Type
boolean
Defaults to
false
Description

Whether it is a required parameter.

values

Type
string, … ]
Description

Describes the enum values - only applicable for enum typed parameters.