Skip to content

Commit

Permalink
Merge pull request #7 from SouthFluff/master
Browse files Browse the repository at this point in the history
Added a function to allow organization renaming
  • Loading branch information
Denislb authored Jan 12, 2024
2 parents 5daba0a + 61b0400 commit 77636cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions src/jira.js
Original file line number Diff line number Diff line change
Expand Up @@ -2089,6 +2089,27 @@ export default class JiraApi {
}));
}

/** Rename an organization.
* [Jira Doc](https://youtu.be/dQw4w9WgXcQ?si=RWwWdNwZ2xBfY9dI)
* @name renameOrganization
* @function
* @param {string} organizationId - The organization identifier.
* @param {string} name - The new organization name.
*/
renameOrganization(organizationId, name) {
return this.doRequest(this.makeRequestHeader(this.makeServiceDeskUri({
intermediatePath: 'rest/servicedesk/1',
pathname: `/organisations/${organizationId}/update`,
}), {
method: 'PUT',
followAllRedirects: true,
body: { newName: name },
headers: {
'X-ExperimentalApi': 'opt-in',
},
}));
}

/** Get Organizations
* [Jira Doc](https://docs.atlassian.com/jira-servicedesk/REST/3.15.1/#servicedeskapi/organization-getOrganizations)
* @name getOrganization
Expand Down

0 comments on commit 77636cd

Please sign in to comment.