Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Section


Column

Introduction to Jira expressions

Jira expressions can be used to evaluate custom code in the context of Jira entities. It’s a domain-specific language designed with Jira in mind, evaluated on the Jira Cloud side. Jira expressions follow JavaScript syntax. You can think of them as a JavaScript dialect. Jira expressions uses a data model loosely inspired by Jira's REST API JSON model. You can learn more about the various data types supported by Jira expressions here, and explore them interactively on the Data Types help tab of the Jira expression editor. To quickly find out how to access a particular issue field, you can visit the Issue Fields help tab. Finally, to find out which global ("context") variables can be used in an expression, visit the Global Variables help tab.


Column
width400px


Panel
borderColorsilver
bgColor#f5f5f5
borderWidth1
borderStylesolid

On this page:

Table of Contents



Jira expressions in JMWE for JIRA Cloud

Jira expressions in JMWE for Jira Cloud are used to insert information in

You can insert issue, transition and current user information into the conditions using Jira expressions. 

Scripting features in Jira expressions

...

Limitations of Jira expressions

Jira Cloud enforces the following stringent limitations while using Jira expressions. This section explains them in context to JMWE. For more information, see the official Jira expressions documentation.

  1. The expression's length is limited to 1,000 characters or 100 syntactic elements.
  2. Limitations inside the Jira expressions written by users: The expression can execute at most 10 expensive operations (expensive operations are those that load additional data, such as entity properties, comments, or custom fields). For example, A condition that checks for a version 1.0 on every issue linked to the current issue.

    Code Block
    issue.links.every(link => link.outwardIssue.versions.every(ver => (ver.name == "1.0"))) 
    Code BlocklinkedIssue.customfield_10401

    Evaluation will fail if there are more than 10 linked issues.

    No error reporting: If a Jira expression evaluation returns an error, the error is not reported/logged anywhere. Since any non-boolean value, including an error, will be considered as false the condition will fail. However, you can see the error when you test the Jira expression against an issue in the Jira expressions editor. For example: When you write a condition to check that the linked issue has the multi-select custom field has the value "Database" selected:

    .

    any(it => it.value == "Database")

    the condition when tested will return the following error:

    Image Removed

    You need to instead use the "some" property to check that the specific value is selected.

    Code BlocklinkedIssue.customfield_10401.some(it => it.value == "Database")