diff --git a/CHANGELOG.md b/CHANGELOG.md index a5733a64a..d06bbf969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,11 @@ - `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. --- diff --git a/src/version3/classificationLevels.ts b/src/version3/classificationLevels.ts new file mode 100644 index 000000000..5f9b3a579 --- /dev/null +++ b/src/version3/classificationLevels.ts @@ -0,0 +1,43 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ClassificationLevels { + constructor(private client: Client) {} + + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters: Parameters.GetAllUserDataClassificationLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: never, + ): Promise; + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/classification-levels', + method: 'GET', + params: { + status: parameters?.status, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueBulkOperations.ts b/src/version3/issueBulkOperations.ts new file mode 100644 index 000000000..de06dd95d --- /dev/null +++ b/src/version3/issueBulkOperations.ts @@ -0,0 +1,520 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class IssueBulkOperations { + constructor(private client: Client) {} + + /** + * Use this API to submit a bulk delete request. You can delete up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Delete [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Delete-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkDelete( + parameters: Parameters.SubmitBulkDelete, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk delete request. You can delete up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Delete [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Delete-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkDelete( + parameters: Parameters.SubmitBulkDelete, + callback?: never, + ): Promise; + async submitBulkDelete( + parameters: Parameters.SubmitBulkDelete, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/delete', + method: 'POST', + data: { + selectedIssueIdsOrKeys: parameters.selectedIssueIdsOrKeys, + sendBulkNotification: parameters.sendBulkNotification, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to get a list of fields visible to the user to perform bulk edit operations. You can pass single or + * multiple issues in the query to get eligible editable fields. This API uses pagination to return responses, + * delivering 50 fields at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - Depending on the field, any field-specific permissions required to edit it. + */ + async getBulkEditableFields( + parameters: Parameters.GetBulkEditableFields, + callback: Callback, + ): Promise; + /** + * Use this API to get a list of fields visible to the user to perform bulk edit operations. You can pass single or + * multiple issues in the query to get eligible editable fields. This API uses pagination to return responses, + * delivering 50 fields at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - Depending on the field, any field-specific permissions required to edit it. + */ + async getBulkEditableFields( + parameters: Parameters.GetBulkEditableFields, + callback?: never, + ): Promise; + async getBulkEditableFields( + parameters: Parameters.GetBulkEditableFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/fields', + method: 'GET', + params: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + searchText: parameters.searchText, + endingBefore: parameters.endingBefore, + startingAfter: parameters.startingAfter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to submit a bulk edit request and simultaneously edit multiple issues. There are limits applied to the + * number of issues and fields that can be edited. A single request can accommodate a maximum of 1000 issues + * (including subtasks) and 200 fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - Edit [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in all projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkEdit( + parameters: Parameters.SubmitBulkEdit, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk edit request and simultaneously edit multiple issues. There are limits applied to the + * number of issues and fields that can be edited. A single request can accommodate a maximum of 1000 issues + * (including subtasks) and 200 fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - Edit [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in all projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkEdit( + parameters: Parameters.SubmitBulkEdit, + callback?: never, + ): Promise; + async submitBulkEdit( + parameters: Parameters.SubmitBulkEdit, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/fields', + method: 'POST', + data: { + editedFieldsInput: parameters.editedFieldsInput, + selectedActions: parameters.selectedActions, + selectedIssueIdsOrKeys: parameters.selectedIssueIdsOrKeys, + sendBulkNotification: parameters.sendBulkNotification, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to submit a bulk issue move request. You can move multiple issues, but they must all be moved to and + * from a single project, issue type, and parent. You can't move more than 1000 issues (including subtasks) at once. + * + * #### Scenarios: + * + * This is an early version of the API and it doesn't have full feature parity with the Bulk Move UI experience. + * + * - Moving issue of type A to issue of type B in the same project or a different project: `SUPPORTED` + * - Moving multiple issues of type A in one project to multiple issues of type B in the same project or a different + * project: **`SUPPORTED`** + * - Moving a standard parent issue of type A with its multiple subtask issue types in one project to standard issue of + * type B and multiple subtask issue types in the same project or a different project: `SUPPORTED` + * - Moving an epic issue with its child issues to a different project without losing their relation: `NOT SUPPORTED`\ + * (Workaround: Move them individually and stitch the relationship back with the Bulk Edit API) + * + * #### Limits applied to bulk issue moves: + * + * When using the bulk move, keep in mind that there are limits on the number of issues and fields you can include. + * + * - You can move up to 1,000 issues in a single operation, including any subtasks. + * - All issues must originate from the same project and share the same issue type and parent. + * - The total combined number of fields across all issues must not exceed 1,500,000. For example, if each issue + * includes 15,000 fields, then the maximum number of issues that can be moved is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Move [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in source projects. + * - Create [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects, if moving subtasks only. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkMove( + parameters: Parameters.SubmitBulkMove, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk issue move request. You can move multiple issues, but they must all be moved to and + * from a single project, issue type, and parent. You can't move more than 1000 issues (including subtasks) at once. + * + * #### Scenarios: + * + * This is an early version of the API and it doesn't have full feature parity with the Bulk Move UI experience. + * + * - Moving issue of type A to issue of type B in the same project or a different project: `SUPPORTED` + * - Moving multiple issues of type A in one project to multiple issues of type B in the same project or a different + * project: **`SUPPORTED`** + * - Moving a standard parent issue of type A with its multiple subtask issue types in one project to standard issue of + * type B and multiple subtask issue types in the same project or a different project: `SUPPORTED` + * - Moving an epic issue with its child issues to a different project without losing their relation: `NOT SUPPORTED`\ + * (Workaround: Move them individually and stitch the relationship back with the Bulk Edit API) + * + * #### Limits applied to bulk issue moves: + * + * When using the bulk move, keep in mind that there are limits on the number of issues and fields you can include. + * + * - You can move up to 1,000 issues in a single operation, including any subtasks. + * - All issues must originate from the same project and share the same issue type and parent. + * - The total combined number of fields across all issues must not exceed 1,500,000. For example, if each issue + * includes 15,000 fields, then the maximum number of issues that can be moved is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Move [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in source projects. + * - Create [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects, if moving subtasks only. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkMove( + parameters: Parameters.SubmitBulkMove, + callback?: never, + ): Promise; + async submitBulkMove( + parameters: Parameters.SubmitBulkMove, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/move', + method: 'POST', + data: { + sendBulkNotification: parameters.sendBulkNotification, + targetToSourcesMapping: parameters.targetToSourcesMapping, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to retrieve a list of transitions available for the specified issues that can be used or bulk + * transition operations. You can submit either single or multiple issues in the query to obtain the available + * transitions. + * + * The response will provide the available transitions for issues, organized by their respective workflows. **Only the + * transitions that are common among the issues within that workflow and do not involve any additional field updates + * will be included.** For bulk transitions that require additional field updates, please utilise the Jira Cloud UI. + * + * You can request available transitions for up to 1,000 issues in a single operation. This API uses pagination to + * return responses, delivering 50 workflows at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAvailableTransitions( + parameters: Parameters.GetAvailableTransitions, + callback: Callback, + ): Promise; + /** + * Use this API to retrieve a list of transitions available for the specified issues that can be used or bulk + * transition operations. You can submit either single or multiple issues in the query to obtain the available + * transitions. + * + * The response will provide the available transitions for issues, organized by their respective workflows. **Only the + * transitions that are common among the issues within that workflow and do not involve any additional field updates + * will be included.** For bulk transitions that require additional field updates, please utilise the Jira Cloud UI. + * + * You can request available transitions for up to 1,000 issues in a single operation. This API uses pagination to + * return responses, delivering 50 workflows at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAvailableTransitions( + parameters: Parameters.GetAvailableTransitions, + callback?: never, + ): Promise; + async getAvailableTransitions( + parameters: Parameters.GetAvailableTransitions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/transition', + method: 'GET', + params: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + endingBefore: parameters.endingBefore, + startingAfter: parameters.startingAfter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to submit a bulk issue status transition request. You can transition multiple issues, alongside with + * their valid transition Ids. You can transition up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkTransition( + parameters: Parameters.SubmitBulkTransition, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk issue status transition request. You can transition multiple issues, alongside with + * their valid transition Ids. You can transition up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkTransition( + parameters: Parameters.SubmitBulkTransition, + callback?: never, + ): Promise; + async submitBulkTransition( + parameters: Parameters.SubmitBulkTransition, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/transition', + method: 'POST', + data: { + bulkTransitionInputs: parameters.bulkTransitionInputs, + sendBulkNotification: parameters.sendBulkNotification, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this to get the progress state for the specified bulk operation `taskId`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Administer Jira [global + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/), or be the + * creator of the task. + * + * If the task is running, this resource will return: + * + * { + * "taskId": "10779", + * "status": "RUNNING", + * "progressPercent": 65, + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "created": 1690180055963, + * "started": 1690180056206, + * "updated": 169018005829 + * } + * + * If the task has completed, then this resource will return: + * + * { + * "processedAccessibleIssues": [10001, 10002], + * "created": 1709189449954, + * "progressPercent": 100, + * "started": 1709189450154, + * "status": "COMPLETE", + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "invalidOrInaccessibleIssueCount": 0, + * "taskId": "10000", + * "totalIssueCount": 2, + * "updated": 1709189450354 + * } + * + * **Note:** You can view task progress for up to 14 days from creation. + */ + async getBulkOperationProgress( + parameters: Parameters.GetBulkOperationProgress, + callback: Callback, + ): Promise; + /** + * Use this to get the progress state for the specified bulk operation `taskId`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Administer Jira [global + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/), or be the + * creator of the task. + * + * If the task is running, this resource will return: + * + * { + * "taskId": "10779", + * "status": "RUNNING", + * "progressPercent": 65, + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "created": 1690180055963, + * "started": 1690180056206, + * "updated": 169018005829 + * } + * + * If the task has completed, then this resource will return: + * + * { + * "processedAccessibleIssues": [10001, 10002], + * "created": 1709189449954, + * "progressPercent": 100, + * "started": 1709189450154, + * "status": "COMPLETE", + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "invalidOrInaccessibleIssueCount": 0, + * "taskId": "10000", + * "totalIssueCount": 2, + * "updated": 1709189450354 + * } + * + * **Note:** You can view task progress for up to 14 days from creation. + */ + async getBulkOperationProgress( + parameters: Parameters.GetBulkOperationProgress, + callback?: never, + ): Promise; + async getBulkOperationProgress( + parameters: Parameters.GetBulkOperationProgress, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/bulk/queue/${parameters.taskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issuePriorities.ts b/src/version3/issuePriorities.ts index 4df878f73..03ee8322f 100644 --- a/src/version3/issuePriorities.ts +++ b/src/version3/issuePriorities.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -34,6 +34,9 @@ export class IssuePriorities { /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -44,6 +47,9 @@ export class IssuePriorities { /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -56,6 +62,7 @@ export class IssuePriorities { url: '/rest/api/3/priority', method: 'POST', data: { + avatarId: parameters.avatarId, description: parameters.description, iconUrl: parameters.iconUrl, name: parameters.name, @@ -172,7 +179,9 @@ export class IssuePriorities { maxResults: parameters?.maxResults, id: parameters?.id, projectId: paramSerializer('projectId', parameters?.projectId), + priorityName: parameters?.priorityName, onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, }, }; @@ -208,6 +217,11 @@ export class IssuePriorities { /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -215,6 +229,11 @@ export class IssuePriorities { /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -224,6 +243,7 @@ export class IssuePriorities { url: `/rest/api/3/priority/${parameters.id}`, method: 'PUT', data: { + avatarId: parameters.avatarId, description: parameters.description, iconUrl: parameters.iconUrl, name: parameters.name, @@ -233,4 +253,37 @@ export class IssuePriorities { return this.client.sendRequest(config, callback); } + + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback: Callback): Promise; + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback?: never): Promise; + async deletePriority(parameters: Parameters.DeletePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priority/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/issueResolutions.ts b/src/version3/issueResolutions.ts index 09298953f..6236cbb0a 100644 --- a/src/version3/issueResolutions.ts +++ b/src/version3/issueResolutions.ts @@ -1,12 +1,34 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class IssueResolutions { constructor(private client: Client) {} + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback: Callback): Promise; + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback?: never): Promise; + async getResolutions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } /** * Creates an issue resolution. * @@ -91,8 +113,8 @@ export class IssueResolutions { url: '/rest/api/3/resolution/move', method: 'PUT', data: { - ids: parameters.ids, after: parameters.after, + ids: parameters.ids, position: parameters.position, }, }; @@ -148,6 +170,35 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution( + parameters: Parameters.GetResolution, + callback: Callback, + ): Promise; + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution(parameters: Parameters.GetResolution, callback?: never): Promise; + async getResolution( + parameters: Parameters.GetResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/resolution/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + /** * Updates an issue resolution. * diff --git a/src/version3/models/bulkEditGetFields.ts b/src/version3/models/bulkEditGetFields.ts new file mode 100644 index 000000000..aa79b2e62 --- /dev/null +++ b/src/version3/models/bulkEditGetFields.ts @@ -0,0 +1,11 @@ +import { IssueBulkEditField } from './issueBulkEditField'; + +/** Bulk Edit Get Fields Response. */ +export interface BulkEditGetFields { + /** The end cursor for use in pagination. */ + endingBefore?: string; + /** List of all the fields */ + fields?: IssueBulkEditField[]; + /** The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/models/bulkOperationProgress.ts b/src/version3/models/bulkOperationProgress.ts new file mode 100644 index 000000000..d82833419 --- /dev/null +++ b/src/version3/models/bulkOperationProgress.ts @@ -0,0 +1,32 @@ +import { User } from './user'; + +export interface BulkOperationProgress { + /** A timestamp of when the task was submitted. */ + created?: string; + /** + * Map of issue IDs for which the operation failed and that the user has permission to view, to their one or more + * reasons for failure. These reasons are open-ended text descriptions of the error and are not selected from a + * predefined list of standard reasons. + */ + failedAccessibleIssues?: {}; + /** + * The number of issues that are either invalid or issues that the user doesn't have permission to view, regardless + * of the success or failure of the operation. + */ + invalidOrInaccessibleIssueCount?: number; + /** List of issue IDs for which the operation was successful and that the user has permission to view. */ + processedAccessibleIssues?: number[]; + /** Progress of the task as a percentage. */ + progressPercent?: number; + /** A timestamp of when the task was started. */ + started?: string; + /** The status of the task. */ + status?: 'ENQUEUED' | 'RUNNING' | 'COMPLETE' | 'FAILED' | 'CANCEL_REQUESTED' | 'CANCELLED' | 'DEAD' | string; + submittedBy?: User; + /** The ID of the task. */ + taskId: string; + /** The number of issues that the bulk operation was attempted on. */ + totalIssueCount?: number; + /** A timestamp of when the task progress was last updated. */ + updated?: string; +} diff --git a/src/version3/models/bulkTransitionGetAvailableTransitions.ts b/src/version3/models/bulkTransitionGetAvailableTransitions.ts new file mode 100644 index 000000000..04147a900 --- /dev/null +++ b/src/version3/models/bulkTransitionGetAvailableTransitions.ts @@ -0,0 +1,11 @@ +import { IssueBulkTransitionForWorkflow } from './issueBulkTransitionForWorkflow'; + +/** Bulk Transition Get Available Transitions Response. */ +export interface BulkTransitionGetAvailableTransitions { + /** List of available transitions for bulk transition operation for requested issues grouped by workflow */ + availableTransitions?: IssueBulkTransitionForWorkflow[]; + /** The end cursor for use in pagination. */ + endingBefore?: string; + /** The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/models/createPriorityDetails.ts b/src/version3/models/createPriorityDetails.ts index 6d1af928f..934f9993b 100644 --- a/src/version3/models/createPriorityDetails.ts +++ b/src/version3/models/createPriorityDetails.ts @@ -1,11 +1,42 @@ /** Details of an issue priority. */ export interface CreatePriorityDetails { - /** The name of the priority. Must be unique. */ - name: string; + /** + * The ID for the avatar for the priority. Either the iconUrl or avatarId must be defined, but not both. This + * parameter is nullable and will become mandatory once the iconUrl parameter is deprecated. + */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Either + * the iconUrl or avatarId must be defined, but not both. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; + /** The name of the priority. Must be unique. */ + name: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ statusColor: string; } diff --git a/src/version3/models/dataClassificationLevels.ts b/src/version3/models/dataClassificationLevels.ts new file mode 100644 index 000000000..8358ceb24 --- /dev/null +++ b/src/version3/models/dataClassificationLevels.ts @@ -0,0 +1,7 @@ +import { DataClassificationTag } from './dataClassificationTag'; + +/** The data classification. */ +export interface DataClassificationLevels { + /** The data classifications. */ + classifications?: DataClassificationTag[]; +} diff --git a/src/version3/models/dataClassificationTag.ts b/src/version3/models/dataClassificationTag.ts new file mode 100644 index 000000000..672de56a1 --- /dev/null +++ b/src/version3/models/dataClassificationTag.ts @@ -0,0 +1,17 @@ +/** The data classification. */ +export interface DataClassificationTag { + /** The color of the data classification object. */ + color?: string; + /** The description of the data classification object. */ + description?: string; + /** The guideline of the data classification object. */ + guideline?: string; + /** The ID of the data classification object. */ + id: string; + /** The name of the data classification object. */ + name?: string; + /** The rank of the data classification object. */ + rank?: number; + /** The status of the data classification object. */ + status: string; +} diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts index 12d624864..463dca7a9 100644 --- a/src/version3/models/index.ts +++ b/src/version3/models/index.ts @@ -1,3 +1,12 @@ +export * from './bulkOperationProgress'; +export * from './issueBulkTransitionPayload'; +export * from './bulkTransitionGetAvailableTransitions'; +export * from './issueBulkMovePayload'; +export * from './issueBulkEditPayload'; +export * from './bulkEditGetFields'; +export * from './issueBulkDeletePayload'; +export * from './submittedBulkOperation'; +export * from './dataClassificationLevels'; export * from './workflowSchemeUpdateRequiredMappingsResponse'; export * from './workflowSchemeUpdateRequest'; export * from './workflowSchemeReadRequest'; diff --git a/src/version3/models/issueBulkDeletePayload.ts b/src/version3/models/issueBulkDeletePayload.ts new file mode 100644 index 000000000..100907420 --- /dev/null +++ b/src/version3/models/issueBulkDeletePayload.ts @@ -0,0 +1,14 @@ +/** Issue Bulk Delete Payload */ +export interface IssueBulkDeletePayload { + /** + * List of issue IDs or keys which are to be bulk deleted. These IDs or keys can be from different projects and issue + * types. + */ + selectedIssueIdsOrKeys: string[]; + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being deleted. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; +} diff --git a/src/version3/models/issueBulkEditField.ts b/src/version3/models/issueBulkEditField.ts new file mode 100644 index 000000000..f7b188e5d --- /dev/null +++ b/src/version3/models/issueBulkEditField.ts @@ -0,0 +1,20 @@ +export interface IssueBulkEditField { + /** Description of the field. */ + description?: string; + /** A list of options related to the field, applicable in contexts where multiple selections are allowed. */ + fieldOptions?: {}[]; + /** The unique ID of the field. */ + id?: string; + /** Indicates whether the field is mandatory for the operation. */ + isRequired?: boolean; + /** Specifies supported actions (like add, replace, remove) on multi-select fields via an enum. */ + multiSelectFieldOptions?: ('ADD' | 'REMOVE' | 'REPLACE' | 'REMOVE_ALL' | string)[]; + /** The display name of the field. */ + name?: string; + /** A URL to fetch additional data for the field */ + searchUrl?: string; + /** The type of the field. */ + type?: string; + /** A message indicating why the field is unavailable for editing. */ + unavailableMessage?: string; +} diff --git a/src/version3/models/issueBulkEditPayload.ts b/src/version3/models/issueBulkEditPayload.ts new file mode 100644 index 000000000..c4eb8b98c --- /dev/null +++ b/src/version3/models/issueBulkEditPayload.ts @@ -0,0 +1,23 @@ +import { JiraIssueFields } from './jiraIssueFields'; + +/** Issue Bulk Edit Payload */ +export interface IssueBulkEditPayload { + editedFieldsInput?: JiraIssueFields; + /** + * List of all the field IDs that are to be bulk edited. Each field ID in this list corresponds to a specific + * attribute of an issue that is set to be modified in the bulk edit operation. The relevant field ID can be obtained + * by calling the Bulk Edit Get Fields REST API (documentation available on this page itself). + */ + selectedActions: string[]; + /** + * List of issue IDs or keys which are to be bulk edited. These IDs or keys can be from different projects and issue + * types. + */ + selectedIssueIdsOrKeys: string[]; + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being edited. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; +} diff --git a/src/version3/models/issueBulkMovePayload.ts b/src/version3/models/issueBulkMovePayload.ts new file mode 100644 index 000000000..c90c31762 --- /dev/null +++ b/src/version3/models/issueBulkMovePayload.ts @@ -0,0 +1,24 @@ +/** Issue Bulk Move Payload */ +export interface IssueBulkMovePayload { + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being moved. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; + /** + * An object representing the mapping of issues and data related to destination entities, like fields and statuses, + * that are required during a bulk move. + * + * The key is a string that is created by concatenating the following three entities in order, separated by commas. + * The format is `,,`. It should be unique across mappings provided + * in the payload. If you provide multiple mappings for the same key, only one will be processed. However, the + * operation won't fail, so the error may be hard to track down. + * + * _**Destination project**_ (Required): ID or key of the project to which the issues are being moved. _**Destination + * issueType**_ (Required): ID of the issueType to which the issues are being moved. _**Destination parent ID or + * key**_ (Optional): ID or key of the issue which will become the parent of the issues being moved. Only required + * when the destination issueType is a subtask. + */ + targetToSourcesMapping?: {}; +} diff --git a/src/version3/models/issueBulkTransitionForWorkflow.ts b/src/version3/models/issueBulkTransitionForWorkflow.ts new file mode 100644 index 000000000..710bf66f6 --- /dev/null +++ b/src/version3/models/issueBulkTransitionForWorkflow.ts @@ -0,0 +1,15 @@ +import { SimplifiedIssueTransition } from './simplifiedIssueTransition'; + +export interface IssueBulkTransitionForWorkflow { + /** Indicates whether all the transitions of this workflow are available in the transitions list or not. */ + isTransitionsFiltered?: boolean; + /** List of issue keys from the request which are associated with this workflow. */ + issues?: string[]; + /** + * List of transitions available for issues from the request which are associated with this workflow. + * + * _This list includes only those transitions that are common across the issues in this workflow and do not involve + * any additional field updates._* + */ + transitions?: SimplifiedIssueTransition[]; +} diff --git a/src/version3/models/issueBulkTransitionPayload.ts b/src/version3/models/issueBulkTransitionPayload.ts new file mode 100644 index 000000000..7cd8931d9 --- /dev/null +++ b/src/version3/models/issueBulkTransitionPayload.ts @@ -0,0 +1,18 @@ +import { BulkTransitionSubmitInput } from './bulkTransitionSubmitInput'; + +/** Issue Bulk Transition Payload */ +export interface IssueBulkTransitionPayload { + /** + * List of objects and each object has two properties: + * + * Issues that will be bulk transitioned. TransitionId that corresponds to a specific transition of issues that share + * the same workflow. + */ + bulkTransitionInputs: BulkTransitionSubmitInput[]; + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being transitioned. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; +} diff --git a/src/version3/models/issueTransitionStatus.ts b/src/version3/models/issueTransitionStatus.ts new file mode 100644 index 000000000..09f6b49c7 --- /dev/null +++ b/src/version3/models/issueTransitionStatus.ts @@ -0,0 +1,6 @@ +export interface IssueTransitionStatus { + /** The unique ID of the status. */ + statusId?: number; + /** The name of the status. */ + statusName?: string; +} diff --git a/src/version3/models/jiraIssueFields.ts b/src/version3/models/jiraIssueFields.ts new file mode 100644 index 000000000..e0bea9e37 --- /dev/null +++ b/src/version3/models/jiraIssueFields.ts @@ -0,0 +1,155 @@ +import { JiraCascadingSelectField } from './jiraCascadingSelectField'; +import { JiraNumberField } from './jiraNumberField'; +import { JiraColorField } from './jiraColorField'; +import { JiraDateField } from './jiraDateField'; +import { JiraDateTimeField } from './jiraDateTimeField'; +import { JiraIssueTypeField } from './jiraIssueTypeField'; +import { JiraLabelsField } from './jiraLabelsField'; +import { JiraMultipleGroupPickerField } from './jiraMultipleGroupPickerField'; +import { JiraMultipleSelectUserPickerField } from './jiraMultipleSelectUserPickerField'; +import { JiraMultipleSelectField } from './jiraMultipleSelectField'; +import { JiraMultipleVersionPickerField } from './jiraMultipleVersionPickerField'; +import { JiraMultiSelectComponentField } from './jiraMultiSelectComponentField'; +import { JiraDurationField } from './jiraDurationField'; +import { JiraPriorityField } from './jiraPriorityField'; +import { JiraRichTextField } from './jiraRichTextField'; +import { JiraSingleGroupPickerField } from './jiraSingleGroupPickerField'; +import { JiraSingleLineTextField } from './jiraSingleLineTextField'; +import { JiraSingleSelectUserPickerField } from './jiraSingleSelectUserPickerField'; +import { JiraSingleSelectField } from './jiraSingleSelectField'; +import { JiraSingleVersionPickerField } from './jiraSingleVersionPickerField'; +import { JiraTimeTrackingField } from './jiraTimeTrackingField'; +import { JiraUrlField } from './jiraUrlField'; + +export interface JiraIssueFields { + /** + * Add or clear a cascading select field: + * + * - To add, specify `optionId` for both parent and child. + * - To clear the child, set its `optionId` to null. + * - To clear both, set the parent's `optionId` to null. + */ + cascadingSelectFields?: JiraCascadingSelectField[]; + /** + * Add or clear a number field: + * + * - To add, specify a numeric `value`. + * - To clear, set `value` to `null`. + */ + clearableNumberFields?: JiraNumberField[]; + /** + * Add or clear a color field: + * + * - To add, specify the color `name`. Available colors are: `purple`, `blue`, `green`, `teal`, `yellow`, `orange`, + * `grey`, `dark purple`, `dark blue`, `dark green`, `dark teal`, `dark yellow`, `dark orange`, `dark grey`. + * - To clear, set the color `name` to an empty string. + */ + colorFields?: JiraColorField[]; + /** + * Add or clear a date picker field: + * + * - To add, specify the date in `d/mmm/yy` format or ISO format `dd-mm-yyyy`. + * - To clear, set `formattedDate` to an empty string. + */ + datePickerFields?: JiraDateField[]; + /** + * Add or clear the planned start date and time: + * + * - To add, specify the date and time in ISO format for `formattedDateTime`. + * - To clear, provide an empty string for `formattedDateTime`. + */ + dateTimePickerFields?: JiraDateTimeField[]; + issueType?: JiraIssueTypeField; + /** + * Edit a labels field: + * + * - Options include `ADD`, `REPLACE`, `REMOVE`, or `REMOVE_ALL` for bulk edits. + * - To clear labels, use the `REMOVE_ALL` option with an empty `labels` array. + */ + labelsFields?: JiraLabelsField[]; + /** + * Add or clear a multi-group picker field: + * + * - To add groups, provide an array of groups with `groupName`s. + * - To clear all groups, use an empty `groups` array. + */ + multipleGroupPickerFields?: JiraMultipleGroupPickerField[]; + /** + * Assign or unassign multiple users to/from a field: + * + * - To assign, provide an array of user `accountId`s. + * - To clear, set `users` to `null`. + */ + multipleSelectClearableUserPickerFields?: JiraMultipleSelectUserPickerField[]; + /** + * Add or clear a multi-select field: + * + * - To add, provide an array of options with `optionId`s. + * - To clear, use an empty `options` array. + */ + multipleSelectFields?: JiraMultipleSelectField[]; + /** + * Edit a multi-version picker field like Fix Versions/Affects Versions: + * + * - Options include `ADD`, `REPLACE`, `REMOVE`, or `REMOVE_ALL` for bulk edits. + * - To clear the field, use the `REMOVE_ALL` option with an empty `versions` array. + */ + multipleVersionPickerFields?: JiraMultipleVersionPickerField[]; + multiselectComponents?: JiraMultiSelectComponentField; + originalEstimateField?: JiraDurationField; + priority?: JiraPriorityField; + /** + * Add or clear a rich text field: + * + * - To add, provide `adfValue`. Note that rich text fields only support ADF values. + * - To clear, use an empty `richText` object. + * + * For ADF format details, refer to: [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure). + */ + richTextFields?: JiraRichTextField[]; + /** + * Add or clear a single group picker field: + * + * - To add, specify the group with `groupName`. + * - To clear, set `groupName` to an empty string. + */ + singleGroupPickerFields?: JiraSingleGroupPickerField[]; + /** + * Add or clear a single line text field: + * + * - To add, provide the `text` value. + * - To clear, set `text` to an empty string. + */ + singleLineTextFields?: JiraSingleLineTextField[]; + /** + * Edit assignment for single select user picker fields like Assignee/Reporter: + * + * - To assign an issue, specify the user's `accountId`. + * - To unassign an issue, set `user` to `null`. + * - For automatic assignment, set `accountId` to `-1`. + */ + singleSelectClearableUserPickerFields?: JiraSingleSelectUserPickerField[]; + /** + * Add or clear a single select field: + * + * - To add, specify the option with an `optionId`. + * - To clear, pass an option with `optionId` as `-1`. + */ + singleSelectFields?: JiraSingleSelectField[]; + /** + * Add or clear a single version picker field: + * + * - To add, specify the version with a `versionId`. + * - To clear, set `versionId` to `-1`. + */ + singleVersionPickerFields?: JiraSingleVersionPickerField[]; + timeTrackingField?: JiraTimeTrackingField; + /** + * Add or clear a URL field: + * + * - To add, provide the `url` with the desired URL value. + * - To clear, set `url` to an empty string. + */ + urlFields?: JiraUrlField[]; +} diff --git a/src/version3/models/simplifiedIssueTransition.ts b/src/version3/models/simplifiedIssueTransition.ts new file mode 100644 index 000000000..9d2f10eee --- /dev/null +++ b/src/version3/models/simplifiedIssueTransition.ts @@ -0,0 +1,9 @@ +import { IssueTransitionStatus } from './issueTransitionStatus'; + +export interface SimplifiedIssueTransition { + to?: IssueTransitionStatus; + /** The unique ID of the transition. */ + transitionId?: number; + /** The name of the transition. */ + transitionName?: string; +} diff --git a/src/version3/models/submittedBulkOperation.ts b/src/version3/models/submittedBulkOperation.ts new file mode 100644 index 000000000..ed54a85ed --- /dev/null +++ b/src/version3/models/submittedBulkOperation.ts @@ -0,0 +1,3 @@ +export interface SubmittedBulkOperation { + taskId?: string; +} diff --git a/src/version3/models/updatePriorityDetails.ts b/src/version3/models/updatePriorityDetails.ts index 7dccc516b..5d61df8da 100644 --- a/src/version3/models/updatePriorityDetails.ts +++ b/src/version3/models/updatePriorityDetails.ts @@ -1,11 +1,39 @@ /** Details of an issue priority. */ export interface UpdatePriorityDetails { - /** The name of the priority. Must be unique. */ - name?: string; + /** The ID for the avatar for the priority. This parameter is nullable and both iconUrl and avatarId cannot be defined. */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Both + * iconUrl and avatarId cannot be defined. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; + /** The name of the priority. Must be unique. */ + name?: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ statusColor?: string; } diff --git a/src/version3/parameters/deletePriority.ts b/src/version3/parameters/deletePriority.ts new file mode 100644 index 000000000..224cd5fc3 --- /dev/null +++ b/src/version3/parameters/deletePriority.ts @@ -0,0 +1,4 @@ +export interface DeletePriority { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version3/parameters/getAllUserDataClassificationLevels.ts b/src/version3/parameters/getAllUserDataClassificationLevels.ts new file mode 100644 index 000000000..eb477fbdd --- /dev/null +++ b/src/version3/parameters/getAllUserDataClassificationLevels.ts @@ -0,0 +1,6 @@ +export interface GetAllUserDataClassificationLevels { + /** Optional set of statuses to filter by. */ + status?: ('PUBLISHED' | 'ARCHIVED' | 'DRAFT' | string)[]; + /** Ordering of the results by a given field. If not provided, values will not be sorted. */ + orderBy?: 'rank' | '-rank' | '+rank' | string; +} diff --git a/src/version3/parameters/getAvailableTransitions.ts b/src/version3/parameters/getAvailableTransitions.ts new file mode 100644 index 000000000..8409ca4d6 --- /dev/null +++ b/src/version3/parameters/getAvailableTransitions.ts @@ -0,0 +1,8 @@ +export interface GetAvailableTransitions { + /** Ids or keys of the issues to get transitions available for them. */ + issueIdsOrKeys: string[]; + /** The end cursor for use in pagination. */ + endingBefore?: string; + /** The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/parameters/getBulkEditableFields.ts b/src/version3/parameters/getBulkEditableFields.ts new file mode 100644 index 000000000..3d218dc71 --- /dev/null +++ b/src/version3/parameters/getBulkEditableFields.ts @@ -0,0 +1,10 @@ +export interface GetBulkEditableFields { + /** The IDs or keys of the issues to get editable fields from. */ + issueIdsOrKeys: string; + /** (Optional)The text to search for in the editable fields. */ + searchText?: string; + /** (Optional)The end cursor for use in pagination. */ + endingBefore?: string; + /** (Optional)The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/parameters/getBulkOperationProgress.ts b/src/version3/parameters/getBulkOperationProgress.ts new file mode 100644 index 000000000..976c68799 --- /dev/null +++ b/src/version3/parameters/getBulkOperationProgress.ts @@ -0,0 +1,4 @@ +export interface GetBulkOperationProgress { + /** The ID of the task. */ + taskId: string; +} diff --git a/src/version3/parameters/getBulkScreenTabs.ts b/src/version3/parameters/getBulkScreenTabs.ts new file mode 100644 index 000000000..6f8227f85 --- /dev/null +++ b/src/version3/parameters/getBulkScreenTabs.ts @@ -0,0 +1,16 @@ +export interface GetBulkScreenTabs { + /** + * The list of screen IDs. To include multiple screen IDs, provide an ampersand-separated list. For example, + * `screenId=10000&screenId=10001`. + */ + screenId?: number[]; + /** + * The list of tab IDs. To include multiple tab IDs, provide an ampersand-separated list. For example, + * `tabId=10000&tabId=10001`. + */ + tabId?: number[]; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. The maximum number is 100, */ + maxResult?: number; +} diff --git a/src/version3/parameters/getResolution.ts b/src/version3/parameters/getResolution.ts new file mode 100644 index 000000000..13eba2326 --- /dev/null +++ b/src/version3/parameters/getResolution.ts @@ -0,0 +1,4 @@ +export interface GetResolution { + /** The ID of the issue resolution value. */ + id: string; +} diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts index 54bf1a40c..f9ee2e529 100644 --- a/src/version3/parameters/index.ts +++ b/src/version3/parameters/index.ts @@ -1,3 +1,14 @@ +export * from './getBulkOperationProgress'; +export * from './submitBulkTransition'; +export * from './getAvailableTransitions'; +export * from './submitBulkMove'; +export * from './submitBulkEdit'; +export * from './getBulkEditableFields'; +export * from './submitBulkDelete'; +export * from './getAllUserDataClassificationLevels'; +export * from './getResolution'; +export * from './deletePriority'; +export * from './getBulkScreenTabs'; export * from './getNotificationSchemeForProject'; export * from './updateWorkflowSchemeMappings'; export * from './updateSchemes'; diff --git a/src/version3/parameters/searchPriorities.ts b/src/version3/parameters/searchPriorities.ts index 2d704bbb3..64c81ab36 100644 --- a/src/version3/parameters/searchPriorities.ts +++ b/src/version3/parameters/searchPriorities.ts @@ -10,6 +10,13 @@ export interface SearchPriorities { * `projectId=10010&projectId=10111`. */ projectId?: string[]; + /** The name of priority to search for. */ + priorityName?: string; /** Whether only the default priority is returned. */ onlyDefault?: boolean; + /** + * Use `schemes` to return the associated priority schemes for each priority. Limited to returning first 15 priority + * schemes per priority. + */ + expand?: 'schemes' | string; } diff --git a/src/version3/parameters/submitBulkDelete.ts b/src/version3/parameters/submitBulkDelete.ts new file mode 100644 index 000000000..623f3ab25 --- /dev/null +++ b/src/version3/parameters/submitBulkDelete.ts @@ -0,0 +1,3 @@ +import { IssueBulkDeletePayload } from '../models'; + +export interface SubmitBulkDelete extends IssueBulkDeletePayload {} diff --git a/src/version3/parameters/submitBulkEdit.ts b/src/version3/parameters/submitBulkEdit.ts new file mode 100644 index 000000000..a00603a06 --- /dev/null +++ b/src/version3/parameters/submitBulkEdit.ts @@ -0,0 +1,3 @@ +import { IssueBulkEditPayload } from '../models'; + +export interface SubmitBulkEdit extends IssueBulkEditPayload {} diff --git a/src/version3/parameters/submitBulkMove.ts b/src/version3/parameters/submitBulkMove.ts new file mode 100644 index 000000000..198ed83ac --- /dev/null +++ b/src/version3/parameters/submitBulkMove.ts @@ -0,0 +1,3 @@ +import { IssueBulkMovePayload } from '../models'; + +export interface SubmitBulkMove extends IssueBulkMovePayload {} diff --git a/src/version3/parameters/submitBulkTransition.ts b/src/version3/parameters/submitBulkTransition.ts new file mode 100644 index 000000000..21b62066a --- /dev/null +++ b/src/version3/parameters/submitBulkTransition.ts @@ -0,0 +1,3 @@ +import { IssueBulkTransitionPayload } from '../models'; + +export interface SubmitBulkTransition extends IssueBulkTransitionPayload {} diff --git a/src/version3/screenTabs.ts b/src/version3/screenTabs.ts index 370565a10..683f5ccdc 100644 --- a/src/version3/screenTabs.ts +++ b/src/version3/screenTabs.ts @@ -1,12 +1,50 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; export class ScreenTabs { constructor(private client: Client) {} + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs( + parameters: Parameters.GetBulkScreenTabs | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs(parameters?: Parameters.GetBulkScreenTabs, callback?: never): Promise; + async getBulkScreenTabs( + parameters?: Parameters.GetBulkScreenTabs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screens/tabs', + method: 'GET', + params: { + screenId: paramSerializer('screenId', parameters?.screenId), + tabId: parameters?.tabId, + startAt: parameters?.startAt, + maxResult: parameters?.maxResult, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns the list of tabs for a screen. *