Function: searchProjects()
ts
function searchProjects(
client,
parameters?,
options?
): Promise<{
[key: string]: unknown;
isLast: boolean;
maxResults: number;
nextPage?: string;
self?: string;
startAt: number;
total: number;
values: object[];
}>;Defined in: src/cloud/api/projects.ts:91
Returns a paginated list of projects visible to the user.
This operation can be accessed anonymously.
Permissions required: Projects are returned only where the user has one of:
- Browse Projects project permission for the project.
- Administer Projects project permission for the project.
- Administer Jira global permission.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Client | - |
parameters? | { action?: "view" | string & object | "edit" | "create" | "browse"; categoryId?: number; expand?: | "url" | "description" | string & object | "issueTypes" | "lead" | "insight" | "projectKeys" | ( | "url" | "description" | string & object | "issueTypes" | "lead" | "insight" | "projectKeys")[]; id?: number[]; keys?: string[]; maxResults?: number; orderBy?: | "name" | "key" | string & object | "category" | "owner" | "archivedDate" | "deletedDate" | "issueCount" | "-name" | "+name" | "-issueCount" | "+issueCount" | "-owner" | "+owner" | "-category" | "+category" | "-key" | "+key" | "lastIssueUpdatedDate" | "-lastIssueUpdatedDate" | "+lastIssueUpdatedDate" | "+archivedDate" | "-archivedDate" | "+deletedDate" | "-deletedDate"; properties?: Record<string, never>[]; propertyQuery?: string; query?: string; startAt?: number; status?: ("deleted" | "live" | string & object | "archived")[]; typeKey?: string | string[]; } | - |
parameters.action? | "view" | string & object | "edit" | "create" | "browse" | Filter results by projects for which the user can: - view the project, meaning that they have one of the following permissions: - Browse projects project permission for the project. - Administer projects project permission for the project. - Administer Jira global permission. - browse the project, meaning that they have the Browse projects project permission for the project. - edit the project, meaning that they have one of the following permissions: - Administer projects project permission for the project. - Administer Jira global permission. - create the project, meaning that they have the Create issues project permission for the project in which the issue is created. |
parameters.categoryId? | number | The ID of the project's category. A complete list of category IDs is found using the Get all project categories operation. |
parameters.expand? | | "url" | "description" | string & object | "issueTypes" | "lead" | "insight" | "projectKeys" | ( | "url" | "description" | string & object | "issueTypes" | "lead" | "insight" | "projectKeys")[] | Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: - description Returns the project description. - projectKeys Returns all project keys associated with a project. - lead Returns information about the project lead. - issueTypes Returns all issue types associated with the project. - url Returns the URL associated with the project. - insight EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. |
parameters.id? | number[] | The project IDs to filter the results by. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. Up to 50 project IDs can be provided. |
parameters.keys? | string[] | The project keys to filter the results by. To include multiple keys, provide an ampersand-separated list. For example, keys=PA&keys=PB. Up to 50 project keys can be provided. |
parameters.maxResults? | number | The maximum number of items to return per page. Must be less than or equal to 100. If a value greater than 100 is provided, the maxResults parameter will default to 100. |
parameters.orderBy? | | "name" | "key" | string & object | "category" | "owner" | "archivedDate" | "deletedDate" | "issueCount" | "-name" | "+name" | "-issueCount" | "+issueCount" | "-owner" | "+owner" | "-category" | "+category" | "-key" | "+key" | "lastIssueUpdatedDate" | "-lastIssueUpdatedDate" | "+lastIssueUpdatedDate" | "+archivedDate" | "-archivedDate" | "+deletedDate" | "-deletedDate" | Order the results by a field. - category Sorts by project category. A complete list of category IDs is found using Get all project categories. - issueCount Sorts by the total number of issues in each project. - key Sorts by project key. - lastIssueUpdatedTime Sorts by the last issue update time. - name Sorts by project name. - owner Sorts by project lead. - archivedDate EXPERIMENTAL. Sorts by project archived date. - deletedDate EXPERIMENTAL. Sorts by project deleted date. |
parameters.properties? | Record<string, never>[] | EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. |
parameters.propertyQuery? | string | EXPERIMENTAL. A query string used to search properties. The query string cannot be specified using a JSON object. For example, to search for the value of nested from {"something":{"nested":1,"other":2}} use [thepropertykey].something.nested=1. Note that the propertyQuery key is enclosed in square brackets to enable searching where the propertyQuery key includes dot (.) or equals (=) characters. Note that thepropertykey is only returned when included in properties. |
parameters.query? | string | Filter the results using a literal string. Projects with a matching key or name are returned (case insensitive). |
parameters.startAt? | number | The index of the first item to return in a page of results (page offset). |
parameters.status? | ("deleted" | "live" | string & object | "archived")[] | EXPERIMENTAL. Filter results by project status: - live Search live projects. - archived Search archived projects. - deleted Search deleted projects, those in the recycle bin. |
parameters.typeKey? | string | string[] | Orders results by the project type. This parameter accepts a comma-separated list. Valid values are business, service_desk, and software. |
options? | RequestOptions | - |
Returns
Promise<{ [key: string]: unknown; isLast: boolean; maxResults: number; nextPage?: string; self?: string; startAt: number; total: number; values: object[]; }>