Introduction to Jira Expressions
Last updated
Last updated
Start writing expression by typing issue
or any other available . You can access any properties or methods of an issue using .
notation. Press Ctrl + Space inside the editor to get all possible members you can access. For example, to read the assignee of the issue, type: issue.assignee
. Custom fields can be accessed by field id: issue.customfield_10036
.
The next step is to use one of the comparison operators: ==, !=, <, >, <=, >=
followed by a value. For example, in order to check if an issue is assigned, use: issue.assignee != null
.
Each member has its own type and properties. To check that Jane Doe is assigned to the issue, type: issue.assignee?.displayName == "Jane Doe"
. Note that we used ?.
notation to prevent syntax errors in case the assignee is null (type null does not have any properties).
All types are described in details in .
Expression can be combined using ||
or &&
logical operators and even grouped with parenthesis. It is also possible to create local variables for clarity, e.g.
Jira expressions use JavaScript-like syntax. They support a subset of JavaScript constructs and features which are described in details in .
The following context variables are available to expressions:
user
(): The user the condition is evaluated for.
issue
(): The issue selected for the transition.
project
(): The project the issue belongs to.
transition
(): The transition that the condition is being evaluated against.
workflow
(Workflow): The workflow that contains the condition
Additionally, these are available in Validators:
Additionally, these are available for Jira Service Desk transitions:
originalIssue
(): The issue before changes were made on the transition screen. This variable is not available when validator is defined for the .
customerRequest
(): The customer request selected for transition. It is not available on initial transition (Create issue).
serviceDesk
(): The service desk the customer request belongs to.