import type { ActivityCursorPage, ActivityItem, CustomFieldsParam, Entity, FieldsParam, ListParams, MuteUpdateNotificationsParam, Project, QueryParam, Schema, Sprint, Issue, IssueCountResponse, IssueCustomField, DeepPartial } from "../types"; import { ResourceApi } from "./common"; type IssueSchema = Schema; type ActivityItemSchema = Schema; type IssueCountResponseSchema = Schema; type ActivityCursorPageSchema = Schema; type IssueCustomFieldSchema = Schema; type ProjectSchema = Schema; type SprintSchema = Schema; type IssueEntity = Entity; type ActivityItemEntity = Entity; type IssueCountResponseEntity = Entity; type ActivityCursorPageEntity = Entity; type IssueCustomFieldEntity = Entity; type ProjectEntity = Entity; type SprintEntity = Entity; /** * Resource that provides access to issues. * https://www.jetbrains.com/help/youtrack/devportal/resource-api-issues.html */ export declare class IssuesApi extends ResourceApi { /** * Get all issues that match the specified query. * @param fields - A list of Issue attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Lets you specify the maximum number of entries that are returned in the response. If you don't set the $top value, the server limits the maximum number of returned entries. * @param params.$skip - Optional. Lets you set a number of returned entities to skip before returning the first one. * @param params.query - Issue search query. Read more about the search syntax here: Search Query Reference. * @param params.customFields - The name of the custom field to show in the response. When you use this parameter and request the custom field data in the request URL, the response only shows the requested custom fields instead of all of them. * @returns The list of issues that match the specified query. */ getIssues(params?: FieldsParam | ListParams | CustomFieldsParam | QueryParam): Promise[]>; /** * Create a new issue. * @param body.summary - The summary of the issue. * @param body.project - The project identifier. * @param params.fields - A list of Issue attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set to true if no notifications should be sent on changes made by this request. * @param params.draftId - The ID of the issue draft to create issue from. * @returns The created issue. */ createIssue(body: { summary: string; project: { id: string; }; } & DeepPartial>, params?: FieldsParam & MuteUpdateNotificationsParam & { draftId?: string; }): Promise>; /** * Read an issue with specific ID. * @param issueId - The database ID or project ID of the issue. * @param params.fields - A list of Issue attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The requested issue. */ getIssueById(issueId: string, params?: FieldsParam): Promise>; /** * Update a single issue. * @param issueId - The database ID or project ID of the issue. * @param params.fields - A list of Issue attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set to true if no notifications should be sent on changes made by this request. * @returns The updated issue. */ updateIssue(issueId: string, body: DeepPartial, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Delete the issue. Note that this operation cannot be undone. * @param issueId - The database ID or project ID of the issue. * @param params.fields - A list of Issue attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns A promise that resolves when the issue is deleted. */ deleteIssue(issueId: string, params?: FieldsParam): Promise>; /** * Get the number of issues found by a search. * @param query - The search query to get the number of issues for. * @param fields - A list of IssueCountResponse attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns A promise that resolves to the count of issues. */ getIssueCount(body: { query: string; }, params?: FieldsParam): Promise<{ count: number; } & IssueCountResponseEntity>; /** * Get a list of all activities in the specific issue. * @param issueId - The ID of the issue. * @param params.fields - A list of ActivityItem attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.categories - Mandatory. Filters returned activities by categories. You must specify at least one category per request. * @param params.reverse - Indicates whether the order of returning activities is from newest to oldest or the opposite. Default is false. * @param params.start - The start of the time interval for the activity timestamp in milliseconds. If not set, defaults to 0. * @param params.end - The end of the time interval for the activity timestamp in milliseconds. If not set, defaults to Long.MAX_VALUE. * @param params.author - Filters activities by the author. Can be the database ID, login, Hub ID, or 'me' for the currently logged in user. * @param params.$top - Optional. Specifies the maximum number of entries to return in the response. Default limits apply if not set. * @param params.$skip - Optional. Lets you set a number of returned entities to skip before returning the first one. * @returns A promise that resolves to a list of activities. */ getIssueActivities(issueId: string, params?: FieldsParam & ListParams & { categories: string; reverse?: boolean; start?: string; end?: string; author?: string; }): Promise[]>; /** * Get information about the specific activity in the specific issue. * @param issueId - The Id of the issue. * @param itemId - The database ID of the activity item. * @param params.fields - A list of ActivityItem attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns A promise that resolves to the activity item. */ getIssueActivity(issueId: string, itemId: string, params?: FieldsParam): Promise>; /** * Read a page of activities in the specific issue. * @param issueId - The Id of the issue. * @param params - Parameters for the request. * @param params.fields - A list of ActivityCursorPage attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.categories - Mandatory. Filters returned activities by categories. You must specify at least one category per request. * @param params.reverse - Indicates whether the order of returning activities is from newest to oldest (true) or oldest to newest (false). Defaults to false. * @param params.start - The timestamp in milliseconds indicating the start of the time interval for the activity timestamp. Defaults to 0 if not set. * @param params.end - The timestamp in milliseconds indicating the end of the time interval for the activity timestamp. Defaults to Long.MAX_VALUE if not set. * @param params.author - Filters activities by the author. You can specify the database ID, login, Hub ID, or 'me' for the currently logged in user. * @param params.cursor - For pagination. Use the cursor from the returned activity page to request the next page. * @param params.activityId - ID of the activity to include in the page. This activity is centered on the page. * @returns A promise that resolves to the page of activity items. */ getActivitiesPage(issueId: string, params?: FieldsParam & { categories: string; reverse?: boolean; start?: string; end?: string; author?: string; cursor?: string; activityId?: string; }): Promise>; /** * Get the list of available custom fields of the issue. * @param issueId - The ID of the issue. * @param params.fields - A list of IssueCustomField attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Specifies the maximum number of entries to return. The server returns a maximum of 42 entries if not specified. * @param params.$skip - Optional. Specifies the number of entries to skip before returning the first one. * @returns A promise that resolves to the list of custom fields. */ getIssueCustomFields(issueId: string, params?: FieldsParam & ListParams): Promise[]>; /** * Get a specific custom field in the issue. * @param issueId - The ID of the issue. * @param fieldId - The entity ID of the custom field in the issue. * @param params.fields - A list of IssueCustomField attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns A promise that resolves to the custom field. */ getIssueCustomFieldById(issueId: string, fieldId: string, params?: FieldsParam): Promise>; /** * Update a specific custom field in the issue. * @param issueId - The ID of the issue. * @param fieldId - The entity ID of the custom field in the issue. * @param body - The new value to set for the custom field. * @param params.fields - A list of IssueCustomField attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set to true to suppress notifications about changes made by this request. * @returns A promise that resolves to the updated custom field. */ updateIssueCustomField(issueId: string, fieldId: string, body: DeepPartial, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Get the project to which the issue belongs. * @param issueId - The ID of the issue. * @param params.fields - A list of Project attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns A promise that resolves to the project. */ getIssueProject(issueId: string, params?: FieldsParam): Promise>; /** * Change the project of the issue. That is, move the issue to another project. * @param issueId - The ID of the issue to be moved. * @param body - Required fields: id - the database ID of the project. * @param params.fields - A list of Project attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set this to true if no notifications should be sent on changes made by this request. This doesn't mute notifications sent by any workflow rules. Requires Apply Commands Silently permission. * @returns A promise that resolves to the updated project. */ changeIssueProject(issueId: string, body: { id: string; }, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Get the list of sprints where the issue belongs. * @param issueId - The ID of the issue for which to get the sprints. * @param params.fields - A list of Sprint attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$skip - Optional. Set the number of returned entities to skip before returning the first one. * @param params.$top - Optional. Specify the maximum number of entries to return in the response. If not set, the server limits the number of returned entries. * @returns A promise that resolves to the list of sprints associated with the issue. */ getIssueSprints(issueId: string, params?: FieldsParam & ListParams): Promise[]>; } export {};