type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Remove the default data classification level from a project
* Remove the default data classification level for a project.
**[Permissions](#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).
*/
export async function main(auth: Jira, projectIdOrKey: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/project/${projectIdOrKey}/classification-level/default`
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 396 days ago
type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Remove the default data classification level from a project
* Remove the default data classification level for a project.
**[Permissions](#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).
*/
export async function main(auth: Jira, projectIdOrKey: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/project/${projectIdOrKey}/classification-level/default`
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 823 days ago