...
These scopes are provided as implicit objects and therefore they're always available inside any pipeline expression even if no section like headers:
, vars:
or body:
or was declared or any other allocation was done.
Also see: Implicite Pipeline Objects Reference .
vars
(variables)
This object gives you access to all variables of the current pipeline.
Also see https://logabit.atlassian.net/wiki/spaces/PA/pages/2552856577#vars .
Let's assume, you have defined a variable counter
and you would like to access this counter in your expression, then you could write an expression like this:
...
This object gives you access to all pipeline headers of the current pipeline.
Also see https://logabit.atlassian.net/wiki/spaces/PA/pages/2552856577#headers .
Info |
---|
Do not mix up Pipeline headers with HTTP headers. The latter can be accessed using the |
...
This object gives you access to the current body of the current pipeline.
Also see https://logabit.atlassian.net/wiki/spaces/PA/pages/2552856577#body .
Here is an example which defines an initial body value and replaces this with another text in the pipeline:
...
For more information about all available implicit objects and their attributes, see:
Implicite Pipeline Objects Reference
Navigating nested data structures​
...
Code Block | ||
---|---|---|
| ||
vars: data: {"deeper": null} pipeline: - body.set: if: "${@data.has(#root, 'vars.data')}" value: ${vars.data} |
As you can see in this example, #root
is used here in order to put the whole root context into the utility in order to check for attribute existence by path.
...