POST /rest/api/2/expression/evaluate

Evaluates a Jira expression and returns its value. The difference between this and eval is that this endpoint uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly consistent eval API. This allows for better performance and scalability. In addition, this API's response for JQL evaluation is based on a scrolling view (backed by a nextPageToken) instead of a paginated view (backed by startAt and totalCount).

This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible way. Consult the Jira expressions documentation for more details.

Context variables

The following context variables are available to Jira expressions evaluated by this resource. Their presence depends on various factors; usually you need to manually request them in the context object sent in the payload, but some of them are added automatically under certain conditions.

In addition, you can pass custom context variables along with their types. You can then access them from the Jira expression by key. You can use the following variables in a custom context:

This operation can be accessed anonymously.

Permissions required: None. However, an expression may return different results for different users depending on their permissions. For example, different users may see different comments on the same issue.
Permission to access Jira Software is required to access Jira Software context variables (board and sprint) or fields (for example, issue.sprint).

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Query parameters

Name Type Required Description
expand String No

Use expand to include additional information in the response. This parameter accepts meta.complexity that returns information about the expression complexity. For example, the number of expensive operations used by the expression and how close the expression is to reaching the complexity limit. Useful when designing and debugging your expressions.

Request body fields

Name Type Required Description
expression String Yes

The Jira expression to evaluate.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.