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

KeyDatatypeRequiredDescription
checkstringThe check to perform:
  • syntax Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are validated. For example, the expression's length.
  • type EXPERIMENTAL. 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.
  • complexity EXPERIMENTAL. Determines the formulae for how many expensive operations each expression may execute. |

Request Body

{"expressions"=>["<string>", "<string>"], "contextVariables"=>"<object>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{&quot;results&quot;:[{&quot;expression&quot;:&quot;analysed expression&quot;,&quot;errors&quot;:[{&quot;line&quot;:1,&quot;column&quot;:4,&quot;message&quot;:&quot;!, -, typeof, (, IDENTIFIER, null, true, false, NUMBER, STRING, new, [ or { expected, \u003e encountered.&quot;,&quot;type&quot;:&quot;syntax&quot;},{&quot;message&quot;:&quot;Jira expression is too long (1040), limit: 1000 characters&quot;,&quot;type&quot;:&quot;other&quot;},{&quot;message&quot;:&quot;Jira expression has too many nodes (150), limit: 100 leaves&quot;,&quot;type&quot;:&quot;other&quot;}],&quot;valid&quot;:false},{&quot;expression&quot;:&quot;issues.map(i =\u003e {idAndKey: [i.id, i.key], summary: i.summary, comments: i.comments})&quot;,&quot;valid&quot;:true,&quot;type&quot;:&quot;List\u003c{idAndKey: [Number, String], summary: String, comments: List\u003cComment\u003e}\u003e&quot;,&quot;complexity&quot;:{&quot;expensiveOperations&quot;:&quot;N&quot;,&quot;variables&quot;:{&quot;N&quot;:&quot;issues&quot;}}},{&quot;expression&quot;:&quot;issues.map(i =\u003e i.id \u003e &#39;0&#39;)&quot;,&quot;errors&quot;:[{&quot;expression&quot;:&quot;i.id \u003e 0&quot;,&quot;message&quot;:&quot;Can&#39;t compare Number to String.&quot;,&quot;type&quot;:&quot;type&quot;}],&quot;valid&quot;:false,&quot;type&quot;:&quot;TypeError&quot;}]}