Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
show-titlefalse
titleDescription

Userscripts for Confluence defines a userscript in form of a descriptor with a reference to the actual script code.

The userscript is configured for users by the administration team. Hence users can benefit from additional functions without bothering to validate the fitness of a script for their task by themselves. This makes extending Confluence easier, especially for team members without programming skills. While these additional features can be implemented in form of Confluence apps, many utilities simply rely on a short amount of JavaScript code. These few lines of code are easily shared and boost the productivity of teams.

The userscript consists of

  1. an 
    Static Document Link
    documentUserscript Identifier
    labelidentifier
    consisting of
    Static Document Link
    documentUserscript Namespace
    label${Short Name}
    to-lower-casetrue
    Static Document Link
    documentUserscript Name
    label${Short Name}
    to-lower-casetrue
    , and 
    Static Document Link
    documentUserscript Version
    label${Short Name}
    to-lower-casetrue
  2. a reference to the userscript code (scriptthe 
    Static Document Link
    documentUserscript Code
    to-lower-casetrue
    (
    Static Document Link
    documentUserscript Code URL
    labelscript
    )
  3. metadata, like a a description, a reference to further information (documentation), and an author
  4. an activation record (activation) that defines when the userscript is actually executed

The following fragment shows the basic structure of a

Static Document Link
documentUserscript JSON
labeluserscript in JSON
.

Code Block
languagejs
titleUserscript Descriptor
{
  "namespace": "...",
  "name": "...",
  "version": "...",

  "script": "...",

  "description": "...",
  "documentation": "...",
  "author": "...",

  "activation": {
     ...
  }
}

...