jira.js
    Preparing search index...

    Function evaluateJSISJiraExpression

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

      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.

      • user (User): The current user. Always available and equal to null if the request is anonymous.
      • app (App): The Connect app that made the request. Available only for authenticated requests made by Connect apps (read more here: Authentication for Connect apps).
      • issue (Issue): The current issue. Available only when the issue is provided in the request context object.
      • issues (List of Issues): A collection of issues matching a JQL query. Available only when JQL is provided in the request context object.
      • project (Project): The current project. Available only when the project is provided in the request context object.
      • sprint (Sprint): The current sprint. Available only when the sprint is provided in the request context object.
      • board (Board): The current board. Available only when the board is provided in the request context object.
      • serviceDesk (ServiceDesk): The current service desk. Available only when the service desk is provided in the request context object.
      • customerRequest (CustomerRequest): The current customer request. Available only when the customer request is provided in the request context object.

      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:

      • user: A user specified as an Atlassian account ID.
      • issue: An issue specified by ID or key. All the fields of the issue object are available in the Jira expression.
      • json: A JSON object containing custom content.
      • list: A JSON list of user, issue, or json variable types.

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

      Parameters

      • client: Client
      • parameters: {
            context?: {
                board?: number;
                custom?: (
                    | { accountId: string; type: "user"; [key: string]: unknown }
                    | { id?: number; key?: string; type: "issue"; [key: string]: unknown }
                    | { type: "json"; value?: Record<string, any>; [key: string]: unknown }
                )[];
                customerRequest?: number;
                issue?: { id?: number; key?: string; [key: string]: unknown };
                issues?: {
                    jql?: {
                        maxResults?: number;
                        nextPageToken?: string;
                        query?: string;
                        [key: string]: unknown;
                    };
                    [key: string]: unknown;
                };
                project?: { id?: number; key?: string; [key: string]: unknown };
                serviceDesk?: number;
                sprint?: number;
                [key: string]: unknown;
            };
            expand?: | string
            | string[]
            | string & {}
            | (string & {} | "meta.complexity")[];
            expression: string;
        }
        • Optionalcontext?: {
              board?: number;
              custom?: (
                  | { accountId: string; type: "user"; [key: string]: unknown }
                  | { id?: number; key?: string; type: "issue"; [key: string]: unknown }
                  | { type: "json"; value?: Record<string, any>; [key: string]: unknown }
              )[];
              customerRequest?: number;
              issue?: { id?: number; key?: string; [key: string]: unknown };
              issues?: {
                  jql?: {
                      maxResults?: number;
                      nextPageToken?: string;
                      query?: string;
                      [key: string]: unknown;
                  };
                  [key: string]: unknown;
              };
              project?: { id?: number; key?: string; [key: string]: unknown };
              serviceDesk?: number;
              sprint?: number;
              [key: string]: unknown;
          }
          • Optionalboard?: number

            The ID of the board that is available under the board variable when evaluating the expression.

          • Optionalcustom?: (
                | { accountId: string; type: "user"; [key: string]: unknown }
                | { id?: number; key?: string; type: "issue"; [key: string]: unknown }
                | { type: "json"; value?: Record<string, any>; [key: string]: unknown }
            )[]

            Custom context variables and their types. These variable types are available for use in a custom context:

            • user: A user specified as an Atlassian account ID.
            • issue: An issue specified by ID or key. All the fields of the issue object are available in the Jira expression.
            • json: A JSON object containing custom content.
            • list: A JSON list of user, issue, or json variable types.
          • OptionalcustomerRequest?: number

            The ID of the customer request that is available under the customerRequest variable when evaluating the expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will have a different type.

          • Optionalissue?: { id?: number; key?: string; [key: string]: unknown }
            • Optionalid?: number

              The ID of the referenced item.

            • Optionalkey?: string

              The key of the referenced item.

          • Optionalissues?: {
                jql?: {
                    maxResults?: number;
                    nextPageToken?: string;
                    query?: string;
                    [key: string]: unknown;
                };
                [key: string]: unknown;
            }
            • Optionaljql?: {
                  maxResults?: number;
                  nextPageToken?: string;
                  query?: string;
                  [key: string]: unknown;
              }
              • OptionalmaxResults?: number

                The maximum number of issues to return from the JQL query. max results value considered may be lower than the number specific here.

              • OptionalnextPageToken?: string

                The token for a page to fetch that is not the first page. The first page has a nextPageToken of null. Use the nextPageToken to fetch the next page of issues.

              • Optionalquery?: string

                The JQL query, required to be bounded. Additionally, orderBy clause can contain a maximum of 7 fields

          • Optionalproject?: { id?: number; key?: string; [key: string]: unknown }
            • Optionalid?: number

              The ID of the referenced item.

            • Optionalkey?: string

              The key of the referenced item.

          • OptionalserviceDesk?: number

            The ID of the service desk that is available under the serviceDesk variable when evaluating the expression.

          • Optionalsprint?: number

            The ID of the sprint that is available under the sprint variable when evaluating the expression.

        • Optionalexpand?: string | string[] | string & {} | (string & {} | "meta.complexity")[]

          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.

        • expression: string

          The Jira expression to evaluate.

      • Optionaloptions: RequestOptions

      Returns Promise<
          {
              meta?: {
                  complexity?: {
                      beans?: { limit: number; value: number; [key: string]: unknown };
                      expensiveOperations?: {
                          limit: number;
                          value: number;
                          [key: string]: unknown;
                      };
                      primitiveValues?: {
                          limit: number;
                          value: number;
                          [key: string]: unknown;
                      };
                      steps?: { limit: number; value: number; [key: string]: unknown };
                      [key: string]: unknown;
                  };
                  issues?: {
                      jql?: {
                          isLast?: boolean;
                          nextPageToken: string
                          | null;
                          [key: string]: unknown;
                      };
                      [key: string]: unknown;
                  };
                  [key: string]: unknown;
              };
              value: unknown;
              [key: string]: unknown;
          },
      >