Section | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Variables available in JMWE
JMWE makes the issue, transition, linkedIssue, parentIssue, now
and currentUser
variables available to templates. You can access their properties using "." or "[ ]". For example, you can access the current issue key using {{issue.key}}
.
issue variable
The issue
variable is used to insert data of the issue being transitioned. You can access the issue data by looking up at its properties.
...
The currentUser
variable is used to insert information about the current user, i.e. the user triggering the transition. Only two properties of the current user are available: key and name. To set a user-type field (such as Assignee, Reporter, or any custom User-picker field), use the name property.
For example:
{{currentUser.name}}
returns the name of the user triggering the transition, e.g. carter.
Use this to set a user-type field (such as Assignee, Reporter, or any custom User-picker field)
{{currentUser.key}}
returns the key of the user triggering the transition, e.g. carter001
...
{{
now}}
returns the current date and time, e.g. 2016-09-30T13:57:23.608Z
User-defined variables
In addition to the above variables, you can also create your own variables within the template using the set Nunjucks tag.
For example:
{% set x = "High" %}
sets the value of the variable x to High. You can also set the variable to an object. For example: {% set assignee = issue.fields.assignee %}