jira.js
    Preparing search index...

    Function searchForProjects

    • Returns a list of projects visible to the user where project name and/or key is matching the given query. Passing an empty (or whitespace only) query will match no projects. The project matches will contain a field with the query highlighted. The number of projects returned can be controlled by passing a value for 'maxResults', but a hard limit of no more than 100 projects is enforced. The projects are wrapped in a single response object that contains a header for use in the picker, specifically 'Showing X of Y matching projects' and the total number of matches for the query.

      Parameters

      • client: Client
      • Optionalparameters: { allowEmptyQuery?: boolean; maxResults?: number; query?: string }
        • OptionalallowEmptyQuery?: boolean

          If true, and the query is empty, the method will return first results limited to the value of 'maxResults' or default limit of 100.

        • OptionalmaxResults?: number

          Maximum number of matches to return. Zero means a default limit of 100 and negative numbers return no results.

        • Optionalquery?: string

          A sequence of characters expected to be found in the word-prefix of project name and/or key.

      • Optionaloptions: RequestOptions

      Returns Promise<
          {
              header?: string;
              projects?: {
                  avatar?: string;
                  html?: string;
                  id?: string;
                  key?: string;
                  name?: string;
                  [key: string]: unknown;
              }[];
              total?: number;
              [key: string]: unknown;
          },
      >