Templating
The templating engine is used to render some text (plain or in some markup language).
Each template is available to refer to a context, typically linked to an event. These context items can be rendered directly, enriched through source fields, optionally configured, and finally filtered for additional formatting.
The general format of a template is a string that contains expressions like:
${expression}
Each expression is either a function call or a context reference.
For a function call, the general syntax is:
#.function?name1=value1&name2=value2|filter
Note
A function can have any number of named configuration parameters or none at all like below:
#.function
For a context reference, the general syntax is similar:
ref(.source)?name1=value1&name2=value2|filter
The .source is optional and allows to refine the context reference.
Examples of valid context references:
project
branch.scmBranch|urlencode
promotionRun.changelog?acrossBranches=false
The list of context elements (project, branch, ...) depends on the execution context for the template.
For example, when using notifications, it all depends on the event being subscribed to.
Note
To see the list of possible events and their contexts, see the reference.
The next sections list the available sources, functions, contexts and filters.
There are also special objects, known as templating renderable, which are specific to some contexts, like auto-versioning or workflows.