From 570fbfab4e6c0d53c8db2e0092baad0a49f721c9 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 8 Feb 2025 03:27:56 +0300 Subject: [PATCH] Few incremental improvements --- CHANGELOG.md | 98 +++--- .../models/getAtlassianTeamResponse.ts | 12 + .../models/getPlanOnlyTeamResponse.ts | 16 + src/version3/models/index.ts | 12 + .../pageWithCursorGetPlanResponseForPage.ts | 10 + .../pageWithCursorGetTeamResponseForPage.ts | 10 + src/version3/models/plan.ts | 29 ++ src/version3/models/prioritySchemeId.ts | 8 + ...chemeWithPaginatedPrioritiesAndProjects.ts | 20 ++ src/version3/models/priorityWithSequence.ts | 19 + src/version3/models/serviceRegistry.ts | 15 + .../models/suggestedMappingsRequest.ts | 14 + .../models/updatePrioritySchemeRequest.ts | 16 + .../models/updatePrioritySchemeResponse.ts | 8 + src/version3/parameters/addAtlassianTeam.ts | 6 + src/version3/parameters/archivePlan.ts | 4 + src/version3/parameters/createPlan.ts | 3 + src/version3/parameters/createPlanOnlyTeam.ts | 6 + .../parameters/createPriorityScheme.ts | 3 + src/version3/parameters/deletePlanOnlyTeam.ts | 6 + .../parameters/deletePriorityScheme.ts | 4 + src/version3/parameters/duplicatePlan.ts | 6 + src/version3/parameters/getAtlassianTeam.ts | 6 + .../getAvailablePrioritiesByPriorityScheme.ts | 12 + .../getDefaultProjectClassification.ts | 4 + src/version3/parameters/getPlan.ts | 4 + src/version3/parameters/getPlanOnlyTeam.ts | 6 + src/version3/parameters/getPlans.ts | 10 + .../getPrioritiesByPriorityScheme.ts | 8 + src/version3/parameters/getPrioritySchemes.ts | 32 ++ .../parameters/getProjectsByPriorityScheme.ts | 12 + src/version3/parameters/getTeams.ts | 8 + src/version3/parameters/index.ts | 28 ++ .../parameters/removeAtlassianTeam.ts | 6 + .../removeDefaultProjectClassification.ts | 4 + src/version3/parameters/services.ts | 4 + .../suggestedPrioritiesForMappings.ts | 3 + src/version3/parameters/trashPlan.ts | 4 + .../parameters/updateAtlassianTeam.ts | 6 + .../updateDefaultProjectClassification.ts | 6 + src/version3/parameters/updatePlan.ts | 4 + src/version3/parameters/updatePlanOnlyTeam.ts | 6 + .../parameters/updatePriorityScheme.ts | 6 + src/version3/plans.ts | 291 +++++++++++++++ src/version3/prioritySchemes.ts | 330 ++++++++++++++++++ src/version3/projectClassificationLevels.ts | 121 +++++++ src/version3/serviceRegistry.ts | 38 ++ src/version3/teamsInPlan.ts | 322 +++++++++++++++++ 48 files changed, 1561 insertions(+), 45 deletions(-) create mode 100644 src/version3/models/getAtlassianTeamResponse.ts create mode 100644 src/version3/models/getPlanOnlyTeamResponse.ts create mode 100644 src/version3/models/pageWithCursorGetPlanResponseForPage.ts create mode 100644 src/version3/models/pageWithCursorGetTeamResponseForPage.ts create mode 100644 src/version3/models/plan.ts create mode 100644 src/version3/models/prioritySchemeId.ts create mode 100644 src/version3/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts create mode 100644 src/version3/models/priorityWithSequence.ts create mode 100644 src/version3/models/serviceRegistry.ts create mode 100644 src/version3/models/suggestedMappingsRequest.ts create mode 100644 src/version3/models/updatePrioritySchemeRequest.ts create mode 100644 src/version3/models/updatePrioritySchemeResponse.ts create mode 100644 src/version3/parameters/addAtlassianTeam.ts create mode 100644 src/version3/parameters/archivePlan.ts create mode 100644 src/version3/parameters/createPlan.ts create mode 100644 src/version3/parameters/createPlanOnlyTeam.ts create mode 100644 src/version3/parameters/createPriorityScheme.ts create mode 100644 src/version3/parameters/deletePlanOnlyTeam.ts create mode 100644 src/version3/parameters/deletePriorityScheme.ts create mode 100644 src/version3/parameters/duplicatePlan.ts create mode 100644 src/version3/parameters/getAtlassianTeam.ts create mode 100644 src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts create mode 100644 src/version3/parameters/getDefaultProjectClassification.ts create mode 100644 src/version3/parameters/getPlan.ts create mode 100644 src/version3/parameters/getPlanOnlyTeam.ts create mode 100644 src/version3/parameters/getPlans.ts create mode 100644 src/version3/parameters/getPrioritiesByPriorityScheme.ts create mode 100644 src/version3/parameters/getPrioritySchemes.ts create mode 100644 src/version3/parameters/getProjectsByPriorityScheme.ts create mode 100644 src/version3/parameters/getTeams.ts create mode 100644 src/version3/parameters/removeAtlassianTeam.ts create mode 100644 src/version3/parameters/removeDefaultProjectClassification.ts create mode 100644 src/version3/parameters/services.ts create mode 100644 src/version3/parameters/suggestedPrioritiesForMappings.ts create mode 100644 src/version3/parameters/trashPlan.ts create mode 100644 src/version3/parameters/updateAtlassianTeam.ts create mode 100644 src/version3/parameters/updateDefaultProjectClassification.ts create mode 100644 src/version3/parameters/updatePlan.ts create mode 100644 src/version3/parameters/updatePlanOnlyTeam.ts create mode 100644 src/version3/parameters/updatePriorityScheme.ts create mode 100644 src/version3/plans.ts create mode 100644 src/version3/prioritySchemes.ts create mode 100644 src/version3/projectClassificationLevels.ts create mode 100644 src/version3/serviceRegistry.ts create mode 100644 src/version3/teamsInPlan.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index fcdb80681..4320c19e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,35 +5,8 @@ // todo add links to code for new classes and modified methods - **General Improvements:** Enhanced JSDoc documentation across the project for better clarity and developer experience. -- **Fix:** Updated the following methods in `Version2Client` and `Version3Client` to make the `parameters` argument mandatory (as it should have been initially): - - `IssueFieldConfigurations.createFieldConfiguration` - - `IssueFieldConfigurations.createFieldConfigurationScheme` - - `IssueLinks.linkIssues` - - `IssueTypeSchemes.createIssueTypeScheme` - - `IssueTypeSchemes.assignIssueTypeSchemeToProject` - - `IssueTypeScreenSchemes.createIssueTypeScreenScheme` - - `JQL.parseJqlQueries` - - `TimeTracking.setSharedTimeTrackingConfiguration` - - `WorkflowSchemeProjectAssociations.assignSchemeToProject` - - `IssueTypes.createIssueType` + - **Improvement:** Changed the return type of `ProjectKeyAndNameValidation.getValidProjectKey` and `ProjectKeyAndNameValidation.getValidProjectName` from `unknown` to `string` for improved type safety and usability. -- **Fix:** Improved the `Avatars.storeAvatar` method: - - Added the `contentType` parameter to specify the type of the uploaded avatar. - - Updated the type of the `avatar` parameter from `any` to `Buffer | ArrayBuffer | Uint8Array | any` for better type safety. - - Set the default value of the `size` parameter to `0`. -- **Fix:** Improved the `IssueTypes.createIssueTypeAvatar` method: - - Added the `contentType` parameter to specify the type of the uploaded avatar. - - Added the `avatar` parameter with the type `Buffer | ArrayBuffer | Uint8Array`. - - Set the default value of the `size` parameter to `0`. -- **New APIs:** Added the following classes to support additional Jira APIs: - - **`AppDataPolicies`**: Manage app access rule data policies, allowing developers to set and retrieve rules controlling app access ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-data-policies/#api-group-app-data-policies)). - - **`ClassificationLevels`**: Define and manage classification levels for sensitive information in Jira ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/#api-group-classification-levels)). - - **`IssueBulkOperations`**: Perform bulk operations on issues, such as moving multiple issues between projects or updating multiple fields in one request. For additional guidance, refer to [Bulk operation APIs: additional examples and FAQ](https://developer.atlassian.com/cloud/jira/platform/bulk-operation-additional-examples-and-faqs/) ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-bulk-operations/#api-group-issue-bulk-operations)). - - **`Plans`**: Manage advanced roadmaps plans, including creating, duplicating, updating, archiving, and trashing plans ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-plans/#api-group-plans)). - - **`PrioritySchemes`**: Create, retrieve, update, and delete issue priority schemes to standardize prioritization across projects ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-priority-schemes/#api-group-priority-schemes)). - - **`ProjectClassificationLevels`**: View and manage classification levels within individual projects to ensure compliance with organizational standards ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-classification-levels/#api-group-project-classification-levels)). - - **`ServiceRegistry`**: Access and manage attributes related to Jira Service Management’s service registry, which helps organize and maintain services ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-service-registry/#api-group-service-registry)). - - **`TeamsInPlan`**: Configure settings for Atlassian and custom teams within advanced roadmaps plans, including creating, updating, and deleting team configurations ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-teams-in-plan/#api-group-teams-in-plan)). - **Improvement:** Added the `extendAdminPermissions` parameter to the following methods in the `Dashboard` class: - `Dashboard.createDashboard` - `Dashboard.updateDashboard` @@ -42,24 +15,29 @@ - **Improvement:** Added the `isSubstringMatch` parameter to the `Filters.getFiltersPaginated` method. - **Improvement:** Updated the `IssueComments.updateComment` method to allow passing a plain string for the comment instead of requiring a specific object format. - **Improvement:** Added the `parentId` parameter to the `IssueComments.deleteComment` method. -- **Deprecation:** Marked the `InstanceInformation.getLicense` method as deprecated. +- **Improvement:** Added the `releasedProjectKeys` property to the `Projects.updateProject` method. +- **Improvement:** Added the `avatarId` parameter to the `IssuePriorities.createPriority` method. This parameter will replace `iconUrl` starting **March 16, 2025**. The `iconUrl` parameter is now marked as deprecated. +- **Improvement:** Added the `priorityName` and `expand` properties to the `IssuePriorities.searchPriorities` method. +- **Improvement:** Added the `avatarId` parameter to the `IssuePriorities.updatePriority` method. This parameter will replace `iconUrl` starting **March 16, 2025**. The `iconUrl` parameter is now marked as deprecated. +- **Improvement:** Added the `issueId` property to the `UserSearch.findAssignableUsers` method. +- **Improvement:** Added the optional `skipNotFoundPrecomputations` property to the `JqlFunctionsApps.updatePrecomputations` method. +- **Improvement:** Added the `failFast` parameter to the `Issues.getIssue` method. +- **Improvement:** Added the `failFast` parameter to the `IssueSearch.searchForIssuesUsingJql` method. +- **Improvement:** Added the `ari` and `metadata` parameters to the `ProjectComponents.createComponent` method. +- **Improvement:** Added the optional `componentSource` parameter to the `ProjectComponents.getProjectComponentsPaginated` method. +- **Improvement:** Added the optional `componentSource` parameter to the `ProjectComponents.getProjectComponents` method. +- **Improvement:** Added the `approvers` and `driver` parameters to the `ProjectVersions.createVersion` and `ProjectVersions.updateVersion` methods. +- **Improvement:** Replaced the `maxResults` property with `maxResult` in the `UserSearch.findUserKeysByQuery` method. + - **New Method:** Added the `getCustomFieldsConfigurations` method to the `IssueCustomFieldConfigurationApps` class. - **New Method:** Added the `replaceCustomFieldOption` method to the `IssueCustomFieldOptions` class. - **New Methods:** Added the following methods to the `WorkflowSchemes` class: - `readWorkflowSchemes`: Retrieve workflow schemes. - `updateSchemes`: Update workflow schemes. - `updateWorkflowSchemeMappings`: Update workflow scheme mappings. -- **Improvement:** Added the `releasedProjectKeys` property to the `Projects.updateProject` method. - **New Method:** Added the `getNotificationSchemeForProject` method to the `Projects` class. - **New Method:** Added the `getBulkScreenTabs` method to the `ScreenTabs` class. -- **Improvement:** Added the `avatarId` parameter to the `IssuePriorities.createPriority` method. This parameter will replace `iconUrl` starting **March 16, 2025**. The `iconUrl` parameter is now marked as deprecated. -- **Improvement:** Added the `priorityName` and `expand` properties to the `IssuePriorities.searchPriorities` method. -- **Improvement:** Added the `avatarId` parameter to the `IssuePriorities.updatePriority` method. This parameter will replace `iconUrl` starting **March 16, 2025**. The `iconUrl` parameter is now marked as deprecated. - **New Method:** Added the `deletePriority` method to the `IssuePriorities` class. -- **Improvement:** Added the `issueId` property to the `UserSearch.findAssignableUsers` method. -- **Fix:** Replaced the `maxResults` property with `maxResult` in the `UserSearch.findUserKeysByQuery` method. -- **Change:** Removed the `filter` parameter from the `JqlFunctionsApps.getPrecomputations` method (experimental method, not a breaking change). -- **Improvement:** Added the optional `skipNotFoundPrecomputations` property to the `JqlFunctionsApps.updatePrecomputations` method. - **New Method:** Added the `getPrecomputationsByID` method to the `JqlFunctionsApps` class. - **New Methods:** Added the following methods to the `Workflows` class: - `readWorkflows`: Retrieve workflows. @@ -74,23 +52,53 @@ - `getCreateIssueMetaIssueTypes`: Retrieve metadata for issue types when creating issues. - `getCreateIssueMetaIssueTypeId`: Retrieve metadata for a specific issue type by ID when creating issues. - `getIssueLimitReport`: Retrieve a report on issue limits. -- **Improvement:** Changed the return type of `Issues.archiveIssuesAsync` from `unknown` to `string` (clarification, not a breaking change). -- **Deprecation:** Marked the `Issues.getCreateIssueMeta` method as deprecated. -- **Improvement:** Added the `failFast` parameter to the `Issues.getIssue` method. - **New Methods:** Added the following methods to the `IssueSearch` class: - `countIssues`: Count issues matching a query. - `searchForIssuesIds`: Search for issue IDs using a query. - `searchForIssuesUsingJqlEnhancedSearch`: Search and reconcile issues using JQL. - `searchForIssuesUsingJqlEnhancedSearchPost`: Search and reconcile issues using JQL via POST request. -- **Fix:** Made the `parameters` argument mandatory for the following methods in the `IssueSearch` class (as it should have been initially): - - `IssueSearch.matchIssues` - - `IssueSearch.searchForIssuesUsingJql` -- **Improvement:** Added the `failFast` parameter to the `IssueSearch.searchForIssuesUsingJql` method. - **New Methods:** Added the following methods to the `IssueWorklogs` class: - `bulkDeleteWorklogs`: Delete multiple worklogs in bulk. - `bulkMoveWorklogs`: Move multiple worklogs in bulk. -- **Fix:** Made the `parameters` argument mandatory for the `JiraExpressions.evaluateJiraExpression` method (as it should have been initially). - **New Method:** Added the `evaluateJiraExpressionUsingEnhancedSearch` method to the `JiraExpressions` class. +- **New Method:** Added the `findComponentsForProjects` method to the `ProjectComponents` class. +- **New Methods:** Added the following methods to the `ProjectVersions` class: + - `deleteRelatedWork`: Delete related work for a version. + - `updateRelatedWork`: Update related work for a version. + - `createRelatedWork`: Create related work for a version. + - `getRelatedWork`: Retrieve related work for a version. + +- **Fix:** Updated the following methods in `Version2Client` and `Version3Client` to make the `parameters` argument mandatory (as it should have been initially): + - `IssueFieldConfigurations.createFieldConfiguration` + - `IssueFieldConfigurations.createFieldConfigurationScheme` + - `IssueLinks.linkIssues` + - `IssueTypeSchemes.createIssueTypeScheme` + - `IssueTypeSchemes.assignIssueTypeSchemeToProject` + - `IssueTypeScreenSchemes.createIssueTypeScreenScheme` + - `JQL.parseJqlQueries` + - `TimeTracking.setSharedTimeTrackingConfiguration` + - `WorkflowSchemeProjectAssociations.assignSchemeToProject` + - `IssueTypes.createIssueType` + - `IssueSearch.matchIssues` + - `IssueSearch.searchForIssuesUsingJql` + - `JiraExpressions.evaluateJiraExpression` +- **Fix:** Improved the `Avatars.storeAvatar` method: + - Added the `contentType` parameter to specify the type of the uploaded avatar. + - Updated the type of the `avatar` parameter from `any` to `Buffer | ArrayBuffer | Uint8Array | any` for better type safety. + - Set the default value of the `size` parameter to `0`. +- **Fix:** Improved the `IssueTypes.createIssueTypeAvatar` method: + - Added the `contentType` parameter to specify the type of the uploaded avatar. + - Added the `avatar` parameter with the type `Buffer | ArrayBuffer | Uint8Array`. + - Set the default value of the `size` parameter to `0`. +- **Fix:** Improved the `ProjectAvatars.createProjectAvatar` method: + - Added the `contentType` parameter to specify the type of the uploaded avatar. + - Updated the type of the `avatar` parameter from `any` to `Buffer | ArrayBuffer | Uint8Array | any`. + - Set the default value of the `size` parameter to `0`. + +- **Change:** Removed the `filter` parameter from the `JqlFunctionsApps.getPrecomputations` method (experimental method, not a breaking change). + +- **Deprecation:** Marked the `InstanceInformation.getLicense` method as deprecated. +- **Deprecation:** Marked the `Issues.getCreateIssueMeta` method as deprecated. --- diff --git a/src/version3/models/getAtlassianTeamResponse.ts b/src/version3/models/getAtlassianTeamResponse.ts new file mode 100644 index 000000000..ad60480d5 --- /dev/null +++ b/src/version3/models/getAtlassianTeamResponse.ts @@ -0,0 +1,12 @@ +export interface GetAtlassianTeamResponse { + /** The capacity for the Atlassian team. */ + capacity?: number; + /** The Atlassian team ID. */ + id: string; + /** The ID of the issue source for the Atlassian team. */ + issueSourceId?: number; + /** The planning style for the Atlassian team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the Atlassian team. */ + sprintLength?: number; +} diff --git a/src/version3/models/getPlanOnlyTeamResponse.ts b/src/version3/models/getPlanOnlyTeamResponse.ts new file mode 100644 index 000000000..5dd4cf00e --- /dev/null +++ b/src/version3/models/getPlanOnlyTeamResponse.ts @@ -0,0 +1,16 @@ +export interface GetPlanOnlyTeamResponse { + /** The capacity for the plan-only team. */ + capacity?: number; + /** The plan-only team ID. */ + id: number; + /** The ID of the issue source for the plan-only team. */ + issueSourceId?: number; + /** The account IDs of the plan-only team members. */ + memberAccountIds?: string[]; + /** The plan-only team name. */ + name: string; + /** The planning style for the plan-only team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the plan-only team. */ + sprintLength?: number; +} diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts index 8572656b6..635a6534c 100644 --- a/src/version3/models/index.ts +++ b/src/version3/models/index.ts @@ -1,3 +1,15 @@ +export * from './getPlanOnlyTeamResponse'; +export * from './getAtlassianTeamResponse'; +export * from './pageWithCursorGetTeamResponseForPage'; +export * from './serviceRegistry'; +export * from './updatePrioritySchemeRequest'; +export * from './updatePrioritySchemeResponse'; +export * from './suggestedMappingsRequest'; +export * from './priorityWithSequence'; +export * from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +export * from './prioritySchemeId'; +export * from './plan'; +export * from './pageWithCursorGetPlanResponseForPage'; export * from './versionRelatedWork'; export * from './component'; export * from './worklogsMoveRequest'; diff --git a/src/version3/models/pageWithCursorGetPlanResponseForPage.ts b/src/version3/models/pageWithCursorGetPlanResponseForPage.ts new file mode 100644 index 000000000..7b6c103de --- /dev/null +++ b/src/version3/models/pageWithCursorGetPlanResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetPlanResponseForPage } from './getPlanResponseForPage'; + +export interface PageWithCursorGetPlanResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetPlanResponseForPage[]; +} diff --git a/src/version3/models/pageWithCursorGetTeamResponseForPage.ts b/src/version3/models/pageWithCursorGetTeamResponseForPage.ts new file mode 100644 index 000000000..015c2316b --- /dev/null +++ b/src/version3/models/pageWithCursorGetTeamResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetTeamResponseForPage } from './getTeamResponseForPage'; + +export interface PageWithCursorGetTeamResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetTeamResponseForPage[]; +} diff --git a/src/version3/models/plan.ts b/src/version3/models/plan.ts new file mode 100644 index 000000000..2b42c63d0 --- /dev/null +++ b/src/version3/models/plan.ts @@ -0,0 +1,29 @@ +import { GetCrossProjectReleaseResponse } from './getCrossProjectReleaseResponse'; +import { GetCustomFieldResponse } from './getCustomFieldResponse'; +import { GetExclusionRulesResponse } from './getExclusionRulesResponse'; +import { GetIssueSourceResponse } from './getIssueSourceResponse'; +import { GetPermissionResponse } from './getPermissionResponse'; +import { GetSchedulingResponse } from './getSchedulingResponse'; + +export interface Plan { + /** The cross-project releases included in the plan. */ + crossProjectReleases?: GetCrossProjectReleaseResponse[]; + /** The custom fields for the plan. */ + customFields?: GetCustomFieldResponse[]; + exclusionRules?: GetExclusionRulesResponse; + /** The plan ID. */ + id: number; + /** The issue sources included in the plan. */ + issueSources?: GetIssueSourceResponse[]; + /** The date when the plan was last saved in UTC. */ + lastSaved?: string; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name?: string; + /** The permissions for the plan. */ + permissions?: GetPermissionResponse[]; + scheduling?: GetSchedulingResponse; + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: 'Active' | 'Trashed' | 'Archived' | string; +} diff --git a/src/version3/models/prioritySchemeId.ts b/src/version3/models/prioritySchemeId.ts new file mode 100644 index 000000000..7438ba3bd --- /dev/null +++ b/src/version3/models/prioritySchemeId.ts @@ -0,0 +1,8 @@ +import { TaskProgressBeanJsonNode } from './taskProgressBeanJsonNode'; + +/** The ID of a priority scheme. */ +export interface PrioritySchemeId { + /** The ID of the priority scheme. */ + id?: string; + task?: TaskProgressBeanJsonNode; +} diff --git a/src/version3/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version3/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts new file mode 100644 index 000000000..3ec69d654 --- /dev/null +++ b/src/version3/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -0,0 +1,20 @@ +import { PageBeanPriorityWithSequence } from './pageBeanPriorityWithSequence'; +import { PageBeanProjectDetails } from './pageBeanProjectDetails'; + +/** A priority scheme with paginated priorities and projects. */ +export interface PrioritySchemeWithPaginatedPrioritiesAndProjects { + default?: boolean; + /** The ID of the default issue priority. */ + defaultPriorityId?: string; + /** The description of the priority scheme */ + description?: string; + /** The ID of the priority scheme. */ + id: string; + isDefault?: boolean; + /** The name of the priority scheme */ + name: string; + priorities?: PageBeanPriorityWithSequence; + projects?: PageBeanProjectDetails; + /** The URL of the priority scheme. */ + self?: string; +} diff --git a/src/version3/models/priorityWithSequence.ts b/src/version3/models/priorityWithSequence.ts new file mode 100644 index 000000000..8012f612a --- /dev/null +++ b/src/version3/models/priorityWithSequence.ts @@ -0,0 +1,19 @@ +/** An issue priority with sequence information. */ +export interface PriorityWithSequence { + /** The description of the issue priority. */ + description?: string; + /** The URL of the icon for the issue priority. */ + iconUrl?: string; + /** The ID of the issue priority. */ + id?: string; + /** Whether this priority is the default. */ + isDefault?: boolean; + /** The name of the issue priority. */ + name?: string; + /** The URL of the issue priority. */ + self?: string; + /** The sequence of the issue priority. */ + sequence?: string; + /** The color used to indicate the issue priority. */ + statusColor?: string; +} diff --git a/src/version3/models/serviceRegistry.ts b/src/version3/models/serviceRegistry.ts new file mode 100644 index 000000000..d46bfa2b8 --- /dev/null +++ b/src/version3/models/serviceRegistry.ts @@ -0,0 +1,15 @@ +import { ServiceRegistryTier } from './serviceRegistryTier'; + +export interface ServiceRegistry { + /** Service description */ + description?: string; + /** Service ID */ + id?: string; + /** Service name */ + name?: string; + /** Organization ID */ + organizationId?: string; + /** Service revision */ + revision?: string; + serviceTier?: ServiceRegistryTier; +} diff --git a/src/version3/models/suggestedMappingsRequest.ts b/src/version3/models/suggestedMappingsRequest.ts new file mode 100644 index 000000000..4606cbcdd --- /dev/null +++ b/src/version3/models/suggestedMappingsRequest.ts @@ -0,0 +1,14 @@ +import { SuggestedMappingsForPrioritiesRequestBean } from './suggestedMappingsForPrioritiesRequestBean'; +import { SuggestedMappingsForProjectsRequestBean } from './suggestedMappingsForProjectsRequestBean'; + +/** Details of changes to a priority scheme that require suggested priority mappings. */ +export interface SuggestedMappingsRequest { + /** The maximum number of results that could be on the page. */ + maxResults?: number; + priorities?: SuggestedMappingsForPrioritiesRequestBean; + projects?: SuggestedMappingsForProjectsRequestBean; + /** The id of the priority scheme. */ + schemeId?: number; + /** The index of the first item returned on the page. */ + startAt?: number; +} diff --git a/src/version3/models/updatePrioritySchemeRequest.ts b/src/version3/models/updatePrioritySchemeRequest.ts new file mode 100644 index 000000000..6ec61d28c --- /dev/null +++ b/src/version3/models/updatePrioritySchemeRequest.ts @@ -0,0 +1,16 @@ +import { PriorityMapping } from './priorityMapping'; +import { UpdatePrioritiesInSchemeRequestBean } from './updatePrioritiesInSchemeRequestBean'; +import { UpdateProjectsInSchemeRequestBean } from './updateProjectsInSchemeRequestBean'; + +/** Details of a priority scheme. */ +export interface UpdatePrioritySchemeRequest { + /** The default priority of the scheme. */ + defaultPriorityId?: number; + /** The description of the priority scheme. */ + description?: string; + mappings?: PriorityMapping; + /** The name of the priority scheme. Must be unique. */ + name?: string; + priorities?: UpdatePrioritiesInSchemeRequestBean; + projects?: UpdateProjectsInSchemeRequestBean; +} diff --git a/src/version3/models/updatePrioritySchemeResponse.ts b/src/version3/models/updatePrioritySchemeResponse.ts new file mode 100644 index 000000000..51f1d1b97 --- /dev/null +++ b/src/version3/models/updatePrioritySchemeResponse.ts @@ -0,0 +1,8 @@ +import { PrioritySchemeWithPaginatedPrioritiesAndProjects } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +import { TaskProgressBeanJsonNode } from './taskProgressBeanJsonNode'; + +/** Details of the updated priority scheme. */ +export interface UpdatePrioritySchemeResponse { + priorityScheme?: PrioritySchemeWithPaginatedPrioritiesAndProjects; + task?: TaskProgressBeanJsonNode; +} diff --git a/src/version3/parameters/addAtlassianTeam.ts b/src/version3/parameters/addAtlassianTeam.ts new file mode 100644 index 000000000..6563e6255 --- /dev/null +++ b/src/version3/parameters/addAtlassianTeam.ts @@ -0,0 +1,6 @@ +import { AddAtlassianTeamRequest } from '../models'; + +export interface AddAtlassianTeam extends AddAtlassianTeamRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/archivePlan.ts b/src/version3/parameters/archivePlan.ts new file mode 100644 index 000000000..250cc9759 --- /dev/null +++ b/src/version3/parameters/archivePlan.ts @@ -0,0 +1,4 @@ +export interface ArchivePlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/createPlan.ts b/src/version3/parameters/createPlan.ts new file mode 100644 index 000000000..afab471c4 --- /dev/null +++ b/src/version3/parameters/createPlan.ts @@ -0,0 +1,3 @@ +import { CreatePlanRequest } from '../models'; + +export interface CreatePlan extends CreatePlanRequest {} diff --git a/src/version3/parameters/createPlanOnlyTeam.ts b/src/version3/parameters/createPlanOnlyTeam.ts new file mode 100644 index 000000000..29915aabc --- /dev/null +++ b/src/version3/parameters/createPlanOnlyTeam.ts @@ -0,0 +1,6 @@ +import { CreatePlanOnlyTeamRequest } from '../models'; + +export interface CreatePlanOnlyTeam extends CreatePlanOnlyTeamRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/createPriorityScheme.ts b/src/version3/parameters/createPriorityScheme.ts new file mode 100644 index 000000000..0b4d135d0 --- /dev/null +++ b/src/version3/parameters/createPriorityScheme.ts @@ -0,0 +1,3 @@ +import { CreatePrioritySchemeDetails } from '../models'; + +export interface CreatePriorityScheme extends CreatePrioritySchemeDetails {} diff --git a/src/version3/parameters/deletePlanOnlyTeam.ts b/src/version3/parameters/deletePlanOnlyTeam.ts new file mode 100644 index 000000000..d87ea6bd4 --- /dev/null +++ b/src/version3/parameters/deletePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface DeletePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version3/parameters/deletePriorityScheme.ts b/src/version3/parameters/deletePriorityScheme.ts new file mode 100644 index 000000000..3ac3ff970 --- /dev/null +++ b/src/version3/parameters/deletePriorityScheme.ts @@ -0,0 +1,4 @@ +export interface DeletePriorityScheme { + /** The priority scheme ID. */ + schemeId: number; +} diff --git a/src/version3/parameters/duplicatePlan.ts b/src/version3/parameters/duplicatePlan.ts new file mode 100644 index 000000000..10a25d70f --- /dev/null +++ b/src/version3/parameters/duplicatePlan.ts @@ -0,0 +1,6 @@ +import { DuplicatePlanRequest } from '../models'; + +export interface DuplicatePlan extends DuplicatePlanRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/getAtlassianTeam.ts b/src/version3/parameters/getAtlassianTeam.ts new file mode 100644 index 000000000..b3bc42a2b --- /dev/null +++ b/src/version3/parameters/getAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface GetAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts b/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts new file mode 100644 index 000000000..e576614d0 --- /dev/null +++ b/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetAvailablePrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** The string to query priorities on by name. */ + query?: string; + /** The priority scheme ID. */ + schemeId: string; + /** A list of priority IDs to exclude from the results. */ + exclude?: string[]; +} diff --git a/src/version3/parameters/getDefaultProjectClassification.ts b/src/version3/parameters/getDefaultProjectClassification.ts new file mode 100644 index 000000000..cf8683da7 --- /dev/null +++ b/src/version3/parameters/getDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface GetDefaultProjectClassification { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version3/parameters/getPlan.ts b/src/version3/parameters/getPlan.ts new file mode 100644 index 000000000..8851898df --- /dev/null +++ b/src/version3/parameters/getPlan.ts @@ -0,0 +1,4 @@ +export interface GetPlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/getPlanOnlyTeam.ts b/src/version3/parameters/getPlanOnlyTeam.ts new file mode 100644 index 000000000..f48b73a42 --- /dev/null +++ b/src/version3/parameters/getPlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface GetPlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version3/parameters/getPlans.ts b/src/version3/parameters/getPlans.ts new file mode 100644 index 000000000..2633d4c9e --- /dev/null +++ b/src/version3/parameters/getPlans.ts @@ -0,0 +1,10 @@ +export interface GetPlans { + /** Whether to include trashed plans in the results. */ + includeTrashed?: boolean; + /** Whether to include archived plans in the results. */ + includeArchived?: boolean; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plans to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getPrioritiesByPriorityScheme.ts b/src/version3/parameters/getPrioritiesByPriorityScheme.ts new file mode 100644 index 000000000..76d7512d9 --- /dev/null +++ b/src/version3/parameters/getPrioritiesByPriorityScheme.ts @@ -0,0 +1,8 @@ +export interface GetPrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** The priority scheme ID. */ + schemeId: string; +} diff --git a/src/version3/parameters/getPrioritySchemes.ts b/src/version3/parameters/getPrioritySchemes.ts new file mode 100644 index 000000000..0ce9f0840 --- /dev/null +++ b/src/version3/parameters/getPrioritySchemes.ts @@ -0,0 +1,32 @@ +export interface GetPrioritySchemes { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** + * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, + * `priorityId=10000&priorityId=10001`. + */ + priorityId?: number[]; + /** + * A set of priority scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `schemeId=10000&schemeId=10001`. + */ + schemeId?: number[]; + /** The name of scheme to search for. */ + schemeName?: string; + /** Whether only the default priority is returned. */ + onlyDefault?: boolean; + /** The ordering to return the priority schemes by. */ + orderBy?: 'name' | '+name' | '-name' | string; + /** + * A comma separated list of additional information to return. + * + * - `priorities` will return priorities associated with the priority scheme. + * - `projects` will return projects associated with the priority scheme. + * + * @example + * expand: ['priorities', 'projects']. + */ + expand?: 'priorities' | 'projects' | ('priorities' | 'projects')[] | string | string[]; +} diff --git a/src/version3/parameters/getProjectsByPriorityScheme.ts b/src/version3/parameters/getProjectsByPriorityScheme.ts new file mode 100644 index 000000000..6bbbf10e4 --- /dev/null +++ b/src/version3/parameters/getProjectsByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetProjectsByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ + projectId?: number[]; + /** The priority scheme ID. */ + schemeId: string; + /** The string to query projects on by name. */ + query?: string; +} diff --git a/src/version3/parameters/getTeams.ts b/src/version3/parameters/getTeams.ts new file mode 100644 index 000000000..289f64671 --- /dev/null +++ b/src/version3/parameters/getTeams.ts @@ -0,0 +1,8 @@ +export interface GetTeams { + /** The ID of the plan. */ + planId: number; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plan teams to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts index 07cbaace6..c3216d6ab 100644 --- a/src/version3/parameters/index.ts +++ b/src/version3/parameters/index.ts @@ -1,3 +1,31 @@ +export * from './deletePlanOnlyTeam'; +export * from './updatePlanOnlyTeam'; +export * from './getPlanOnlyTeam'; +export * from './createPlanOnlyTeam'; +export * from './removeAtlassianTeam'; +export * from './updateAtlassianTeam'; +export * from './getAtlassianTeam'; +export * from './addAtlassianTeam'; +export * from './getTeams'; +export * from './services'; +export * from './removeDefaultProjectClassification'; +export * from './updateDefaultProjectClassification'; +export * from './getDefaultProjectClassification'; +export * from './getProjectsByPriorityScheme'; +export * from './getPrioritiesByPriorityScheme'; +export * from './deletePriorityScheme'; +export * from './updatePriorityScheme'; +export * from './getAvailablePrioritiesByPriorityScheme'; +export * from './suggestedPrioritiesForMappings'; +export * from './createPriorityScheme'; +export * from './getPrioritySchemes'; +export * from './trashPlan'; +export * from './duplicatePlan'; +export * from './archivePlan'; +export * from './updatePlan'; +export * from './getPlan'; +export * from './createPlan'; +export * from './getPlans'; export * from './deleteRelatedWork'; export * from './updateRelatedWork'; export * from './createRelatedWork'; diff --git a/src/version3/parameters/removeAtlassianTeam.ts b/src/version3/parameters/removeAtlassianTeam.ts new file mode 100644 index 000000000..02650c155 --- /dev/null +++ b/src/version3/parameters/removeAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface RemoveAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version3/parameters/removeDefaultProjectClassification.ts b/src/version3/parameters/removeDefaultProjectClassification.ts new file mode 100644 index 000000000..ed4ea6001 --- /dev/null +++ b/src/version3/parameters/removeDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface RemoveDefaultProjectClassification { + /**The project ID or project key (case-sensitive).*/ + projectIdOrKey: string; +} \ No newline at end of file diff --git a/src/version3/parameters/services.ts b/src/version3/parameters/services.ts new file mode 100644 index 000000000..296a9d043 --- /dev/null +++ b/src/version3/parameters/services.ts @@ -0,0 +1,4 @@ +export interface Services { + /** The ID of the services (the strings starting with "b:" need to be decoded in Base64). */ + serviceIds: string[]; +} diff --git a/src/version3/parameters/suggestedPrioritiesForMappings.ts b/src/version3/parameters/suggestedPrioritiesForMappings.ts new file mode 100644 index 000000000..ed706bf98 --- /dev/null +++ b/src/version3/parameters/suggestedPrioritiesForMappings.ts @@ -0,0 +1,3 @@ +import { SuggestedMappingsRequest } from '../models'; + +export interface SuggestedPrioritiesForMappings extends SuggestedMappingsRequest {} diff --git a/src/version3/parameters/trashPlan.ts b/src/version3/parameters/trashPlan.ts new file mode 100644 index 000000000..e960cc100 --- /dev/null +++ b/src/version3/parameters/trashPlan.ts @@ -0,0 +1,4 @@ +export interface TrashPlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/updateAtlassianTeam.ts b/src/version3/parameters/updateAtlassianTeam.ts new file mode 100644 index 000000000..d5a9fb9df --- /dev/null +++ b/src/version3/parameters/updateAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface UpdateAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version3/parameters/updateDefaultProjectClassification.ts b/src/version3/parameters/updateDefaultProjectClassification.ts new file mode 100644 index 000000000..dc4ae8e91 --- /dev/null +++ b/src/version3/parameters/updateDefaultProjectClassification.ts @@ -0,0 +1,6 @@ +import { UpdateDefaultProjectClassificationBean } from '../models'; + +export interface UpdateDefaultProjectClassification extends UpdateDefaultProjectClassificationBean { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version3/parameters/updatePlan.ts b/src/version3/parameters/updatePlan.ts new file mode 100644 index 000000000..91f5c1602 --- /dev/null +++ b/src/version3/parameters/updatePlan.ts @@ -0,0 +1,4 @@ +export interface UpdatePlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/updatePlanOnlyTeam.ts b/src/version3/parameters/updatePlanOnlyTeam.ts new file mode 100644 index 000000000..7e4b3b582 --- /dev/null +++ b/src/version3/parameters/updatePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface UpdatePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version3/parameters/updatePriorityScheme.ts b/src/version3/parameters/updatePriorityScheme.ts new file mode 100644 index 000000000..bbd7a2f66 --- /dev/null +++ b/src/version3/parameters/updatePriorityScheme.ts @@ -0,0 +1,6 @@ +import { UpdatePrioritySchemeRequest } from '../models'; + +export interface UpdatePriorityScheme extends UpdatePrioritySchemeRequest { + /** The ID of the priority scheme. */ + schemeId: number; +} diff --git a/src/version3/plans.ts b/src/version3/plans.ts new file mode 100644 index 000000000..4b3c291f6 --- /dev/null +++ b/src/version3/plans.ts @@ -0,0 +1,291 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class Plans { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters: Parameters.GetPlans | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters?: Parameters.GetPlans, + callback?: never, + ): Promise; + async getPlans( + parameters?: Parameters.GetPlans, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/plans/plan', + method: 'GET', + params: { + includeTrashed: parameters?.includeTrashed, + includeArchived: parameters?.includeArchived, + cursor: parameters?.cursor, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters: Parameters.CreatePlan, callback: Callback): Promise; + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters: Parameters.CreatePlan, callback?: never): Promise; + async createPlan(parameters: Parameters.CreatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/plans/plan', + method: 'POST', + data: { + crossProjectReleases: parameters.crossProjectReleases, + customFields: parameters.customFields, + exclusionRules: parameters.exclusionRules, + issueSources: parameters.issueSources, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + permissions: parameters.permissions, + scheduling: parameters.scheduling, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback: Callback): Promise; + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback?: never): Promise; + async getPlan(parameters: Parameters.GetPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - LeadAccountId + * - Scheduling + * + * - Estimation with StoryPoints, Days or Hours as possible values + * - StartDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - EndDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - InferredDates with None, SprintDates or ReleaseDates as possible values + * - Dependencies with Sequential or Concurrent as possible values + * - IssueSources + * + * - Type with Board, Project or Filter as possible values + * - Value + * - ExclusionRules + * + * - NumberOfDaysToShowCompletedIssues + * - IssueIds + * - WorkStatusIds + * - WorkStatusCategoryIds + * - IssueTypeIds + * - ReleaseIds + * - CrossProjectReleases + * + * - Name + * - ReleaseIds + * - CustomFields + * + * - CustomFieldId + * - Filter + * - Permissions + * + * - Type with View or Edit as possible values + * - Holder + * + * - Type with Group or AccountId as possible values + * - Value + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback: Callback): Promise; + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - LeadAccountId + * - Scheduling + * + * - Estimation with StoryPoints, Days or Hours as possible values + * - StartDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - EndDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - InferredDates with None, SprintDates or ReleaseDates as possible values + * - Dependencies with Sequential or Concurrent as possible values + * - IssueSources + * + * - Type with Board, Project or Filter as possible values + * - Value + * - ExclusionRules + * + * - NumberOfDaysToShowCompletedIssues + * - IssueIds + * - WorkStatusIds + * - WorkStatusCategoryIds + * - IssueTypeIds + * - ReleaseIds + * - CrossProjectReleases + * + * - Name + * - ReleaseIds + * - CustomFields + * + * - CustomFieldId + * - Filter + * - Permissions + * + * - Type with View or Edit as possible values + * - Holder + * + * - Type with Group or AccountId as possible values + * - Value + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback?: never): Promise; + async updatePlan(parameters: Parameters.UpdatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}`, + method: 'PUT', + // todo + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback: Callback): Promise; + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback?: never): Promise; + async archivePlan(parameters: Parameters.ArchivePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/archive`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback: Callback): Promise; + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: never): Promise; + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/duplicate`, + method: 'POST', + data: { + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback: Callback): Promise; + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback?: never): Promise; + async trashPlan(parameters: Parameters.TrashPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/trash`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/prioritySchemes.ts b/src/version3/prioritySchemes.ts new file mode 100644 index 000000000..c38f4c5b4 --- /dev/null +++ b/src/version3/prioritySchemes.ts @@ -0,0 +1,330 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; +import { Paginated } from '../paginated'; + +export class PrioritySchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes>( + parameters: Parameters.GetPrioritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes>( + parameters?: Parameters.GetPrioritySchemes, + callback?: never, + ): Promise; + async getPrioritySchemes>( + parameters?: Parameters.GetPrioritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + priorityId: paramSerializer('priorityId', parameters?.priorityId), + schemeId: paramSerializer('schemeId', parameters?.schemeId), + schemeName: parameters?.schemeName, + onlyDefault: parameters?.onlyDefault, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback: Callback, + ): Promise; + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback?: never, + ): Promise; + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme', + method: 'POST', + data: { + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorityIds: parameters.priorityIds, + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings>( + parameters: Parameters.SuggestedPrioritiesForMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings>( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: never, + ): Promise; + async suggestedPrioritiesForMappings>( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme/mappings', + method: 'POST', + data: { + maxResults: parameters?.maxResults, + priorities: parameters?.priorities, + projects: parameters?.projects, + schemeId: parameters?.schemeId, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme/priorities/available', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + query: parameters.query, + schemeId: parameters.schemeId, + exclude: parameters.exclude, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback: Callback, + ): Promise; + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: never, + ): Promise; + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}`, + method: 'PUT', + data: { + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorities: parameters.priorities, + projects: parameters.projects, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback: Callback, + ): Promise; + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme(parameters: Parameters.DeletePriorityScheme, callback?: never): Promise; + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}/priorities`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: never, + ): Promise; + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}/projects`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: paramSerializer('projectId', parameters.projectId), + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectClassificationLevels.ts b/src/version3/projectClassificationLevels.ts new file mode 100644 index 000000000..4db335856 --- /dev/null +++ b/src/version3/projectClassificationLevels.ts @@ -0,0 +1,121 @@ +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ProjectClassificationLevels { + constructor(private client: Client) {} + + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: never, + ): Promise; + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: never, + ): Promise; + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: never, + ): Promise; + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/serviceRegistry.ts b/src/version3/serviceRegistry.ts new file mode 100644 index 000000000..b289f99d6 --- /dev/null +++ b/src/version3/serviceRegistry.ts @@ -0,0 +1,38 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ServiceRegistry { + constructor(private client: Client) {} + + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback: Callback): Promise; + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback?: never): Promise; + async services( + parameters: Parameters.Services, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/service-registry', + method: 'GET', + params: { + serviceIds: parameters.serviceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/teamsInPlan.ts b/src/version3/teamsInPlan.ts new file mode 100644 index 000000000..c046b450f --- /dev/null +++ b/src/version3/teamsInPlan.ts @@ -0,0 +1,322 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class TeamsInPlan { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback?: never, + ): Promise; + async getTeams( + parameters: Parameters.GetTeams, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team`, + method: 'GET', + params: { + cursor: parameters.cursor, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback: Callback): Promise; + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: never): Promise; + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian`, + method: 'POST', + data: { + capacity: parameters.capacity, + id: parameters.id, + issueSourceId: parameters.issueSourceId, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: never, + ): Promise; + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback?: never): Promise; + async updateAtlassianTeam( + parameters: Parameters.UpdateAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback: Callback): Promise; + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback?: never): Promise; + async removeAtlassianTeam( + parameters: Parameters.RemoveAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam(parameters: Parameters.CreatePlanOnlyTeam, callback?: never): Promise; + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly`, + method: 'POST', + data: { + capacity: parameters.capacity, + issueSourceId: parameters.issueSourceId, + memberAccountIds: parameters.memberAccountIds, + name: parameters.name, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: never, + ): Promise; + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback?: never): Promise; + async updatePlanOnlyTeam( + parameters: Parameters.UpdatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback: Callback): Promise; + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback?: never): Promise; + async deletePlanOnlyTeam( + parameters: Parameters.DeletePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +}