jira.js
    Preparing search index...

    Function analyseExpression

    • 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.

      Parameters

      • client: Client
      • parameters: {
            check?: "type" | string & {} | "complexity" | "syntax";
            contextVariables?: Record<string, any>;
            expressions: string[];
        }
        • Optionalcheck?: "type" | string & {} | "complexity" | "syntax"

          The 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.
        • OptionalcontextVariables?: Record<string, any>

          Context variables and their types. The type checker assumes that common 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[]

          The list of Jira expressions to analyse.

      • Optionaloptions: RequestOptions

      Returns Promise<
          {
              results: {
                  complexity?: {
                      expensiveOperations: string;
                      variables?: Record<string, any>;
                      [key: string]: unknown;
                  };
                  errors?: {
                      column?: number;
                      expression?: string;
                      line?: number;
                      message: string;
                      type: "type"
                      | "other"
                      | string & {}
                      | "syntax";
                      [key: string]: unknown;
                  }[];
                  expression: string;
                  type?: string;
                  valid: boolean;
                  [key: string]: unknown;
              }[];
              [key: string]: unknown;
          },
      >