Analyse Jira Expression
POST {{baseUrl}}/rest/api/3/expression/analyse?check=syntax
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.
Permissions required: None.
Request Params
| Key | Datatype | Required | Description |
|---|---|---|---|
check | string | The check to perform: |
syntaxEach expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are validated. For example, the expression's length.typeEXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors that would result in the expression failure at runtime are reported. For example, accessing properties that don't exist or passing the wrong number of arguments to functions. Also performs the syntax check.complexityEXPERIMENTAL. Determines the formulae for how many expensive operations each expression may execute. |
Request Body
{"expressions"=>["<string>", "<string>"], "contextVariables"=>"<object>"}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"results":[{"expression":"analysed expression","errors":[{"line":1,"column":4,"message":"!, -, typeof, (, IDENTIFIER, null, true, false, NUMBER, STRING, new, [ or { expected, \u003e encountered.","type":"syntax"},{"message":"Jira expression is too long (1040), limit: 1000 characters","type":"other"},{"message":"Jira expression has too many nodes (150), limit: 100 leaves","type":"other"}],"valid":false},{"expression":"issues.map(i =\u003e {idAndKey: [i.id, i.key], summary: i.summary, comments: i.comments})","valid":true,"type":"List\u003c{idAndKey: [Number, String], summary: String, comments: List\u003cComment\u003e}\u003e","complexity":{"expensiveOperations":"N","variables":{"N":"issues"}}},{"expression":"issues.map(i =\u003e i.id \u003e '0')","errors":[{"expression":"i.id \u003e 0","message":"Can't compare Number to String.","type":"type"}],"valid":false,"type":"TypeError"}]}