Introduction to Jira Expressions
Press Ctrl + Space anywhere inside Jira expression field to get suggestions including available context variables, properties and methods.
Syntax
Start writing expression by typing issue
or any other available context variable. 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 Jira expressions type reference.
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 Jira expressions documentation.
Context Variables
The following context variables are available to expressions:
user
(User): The user the condition is evaluated for.issue
(Issue): The issue selected for the transition.project
(Project): The project the issue belongs to.transition
(Transition): The transition that the condition is being evaluated against.workflow
(Workflow): The workflow that contains the condition
Additionally, these are available in Validators:
originalIssue
(Issue): The issue before changes were made on the transition screen. This variable is not available when validator is defined for the initial transition.
Additionally, these are available for Jira Service Desk transitions:
customerRequest
(CustomerRequest): The customer request selected for transition. It is not available on initial transition (Create issue).serviceDesk
(ServiceDesk): The service desk the customer request belongs to.
Last updated