---
title: "Analyse Jira expression"
method: POST
path: "/rest/api/3/expression/analyse"
tags: ["Jira expressions"]
---

# Analyse Jira expression

`POST /rest/api/3/expression/analyse`

Analyses and validates Jira expressions.

As an experimental feature, this operation can also attempt to type-check the expressions.

Learn more about Jira expressions in the [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/).

**[Permissions](#permissions) required**: None.

## Query parameters

- `check` 'syntax' | 'type' | 'complexity'

## Request body

- JiraExpressionForAnalysis — Details of Jira expressions for analysis.
  - `contextVariables` object — Context variables and their types. The type checker assumes that [common context variables](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables), such as `issue` or `project`, are available in context and sets their type. Use this property to override the default types or provide details of new variables.
  - `expressions` string[], required — The list of Jira expressions to analyse.

## Response `200`

Returned if the request is successful.

- JiraExpressionsAnalysis — Details about the analysed Jira expression.
  - `results` JiraExpressionAnalysis[], required — The results of Jira expressions analysis.
    - `complexity` JiraExpressionComplexity — Details about the complexity of the analysed Jira expression.
      - `expensiveOperations` string, required — Information that can be used to determine how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) the evaluation of the expression will perform. This information may be a formula or number. For example: * `issues.map(i => i.comments)` performs as many expensive operations as there are issues on the issues list. So this parameter returns `N`, where `N` is the size of issue list. * `new Issue(10010).comments` gets comments for one issue, so its complexity is `2` (`1` to retrieve issue 10010 from the database plus `1` to get its comments).
      - `variables` object — Variables used in the formula, mapped to the parts of the expression they refer to.
    - `errors` JiraExpressionValidationError[] — A list of validation errors. Not included if the expression is valid.
      - `column` integer — The text column in which the error occurred.
      - `expression` string — The part of the expression in which the error occurred.
      - `line` integer — The text line in which the error occurred.
      - `message` string, required — Details about the error.
      - `type` 'syntax' | 'type' | 'other', required — The error type.
    - `expression` string, required — The analysed expression.
    - `type` string — EXPERIMENTAL. The inferred type of the expression.
    - `valid` boolean, required — Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime (for example, if it executes too many expensive operations).

## Other responses

- `400` — 400 response
- `401` — Returned if the authentication credentials are incorrect or missing.
- `404` — 404 response

---

[API](https://skmtc.net/atlassian/apis/the-jira-cloud-platform-rest-api-2.md) · [All operations](https://skmtc.net/atlassian/apis/the-jira-cloud-platform-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/the-jira-cloud-platform-rest-api-2/versions/ec7f275dfee5/schema)
