From 09b6e899d4523b55a5501392f4065420e74d0fa1 Mon Sep 17 00:00:00 2001 From: ake Date: Fri, 19 Jan 2024 16:05:47 +0100 Subject: [PATCH] Added deleteOrg function --- src/jira.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/jira.js b/src/jira.js index ec8505a..62f8edd 100644 --- a/src/jira.js +++ b/src/jira.js @@ -2112,7 +2112,7 @@ export default class JiraApi { /** Get Organizations * [Jira Doc](https://docs.atlassian.com/jira-servicedesk/REST/3.15.1/#servicedeskapi/organization-getOrganizations) - * @name getOrganization + * @name getOrganizations * @function * @param {number} [start=0] - The starting index of the returned versions. Base index: 0. * @param {number} [limit=50] - The maximum number of versions to return per page. @@ -2148,6 +2148,23 @@ export default class JiraApi { })); } + /** Delete Organization + * [Jira Doc](https://docs.atlassian.com/jira-servicedesk/REST/3.15.1/#servicedeskapi/organization-deleteOrganization) + * @name deleteOrganization + * @function + * @param {string} organizationId - The organization indentifier. + */ + deleteOrganization(organizationId) { + return this.doRequest(this.makeRequestHeader(this.makeServiceDeskUri({ + pathname: `/organization/${organizationId}`, + }), { + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + })); + } + /** Get Users in an Organization * [Jira Doc](https://docs.atlassian.com/jira-servicedesk/REST/3.15.1/#servicedeskapi/organization-getUsersInOrganization) * @name getUsersInOrganization