User Interface Support

The UI Support element allows you to define how your content property field will be presented in the CQL Builder.

When you define UI support for a field, then the CQL builder will include it in all CQL features in Confluence, including other CQL based macros.

See the content property key documentation for a complete content property example.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "defaultOperator": "~",
  "name": {
    "value": "Content Type",
    "i18n": "attachment.type.name"
  },
  "tooltip": {
    "value": "Content Type Tooltip",
    "i18n": "attachment.type.tooltip"
  },
  "dataUri": "/data/content-types",
  "valueType": "string"
}

Properties

name
Type
Required
Yes
Description

The name of this field as used by the CQL builder UI components.

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.


valueType
Type
Required
Yes
Allowed values
  • space
  • SPACE
  • label
  • LABEL
  • user
  • USER
  • contentid
  • CONTENTID
  • contenttype
  • CONTENTTYPE
  • date
  • DATE
  • string
  • STRING
  • number
  • NUMBER
Description

As well as providing a text field and allowing any entry, the UI support system provides a number of build in components that can enrich the user experience. These provide extra user interface components to allow setting or picking their value in an intuitive way.

The type can be one of the following values:

  • space - provides a space picker and stores the result space key as the result.
  • label - provides a label picker and stores the list of labels as the result.
  • user - provides a user picker and stores the username as the result.
  • contentId - provides a content picker and stores the content id as the result.
  • contentType - provides a content type picker.
  • date - provides a date picker
  • string - provides a free form text field
  • number - provides a free form text field


dataUri
Type
Description

If provided, the CQL builder will provide a drop down and use this url to find the list of value values. This URL should return a json array of objects describing the valid options.

1
2
3
4
5
6

 [
   {"id": "value1", "text": "First Option"},
   {"id": "value2", "text": "Second Option"}
 ]
 

NOTE: since the call to this URL will be made from the user's browser, you need to enable CORS headers for responses to this resource.

Setting a Access-Control-Allow-Origin header to the URL of the Atlassian Cloud instance where this add-on is installed is usually enough to satisfy the CORS requirements. This can be done by tracking the client key and its url in your /installed callback, then looking up the url when the request is made.


defaultOperator
Type
Max length
100
Description

The CQL builder will use this operator when constructing the CQL string.


tooltip
Type
Description

The tooltip of this field as used by the CQL builder UI components.

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.


Rate this page: