type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Create issue type screen scheme
* Creates an issue type screen scheme.
**[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
export async function main(
auth: Jira,
body: {
description?: string;
issueTypeMappings: { issueTypeId: string; screenSchemeId: string }[];
name: string;
}
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issuetypescreenscheme`
);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 327 days ago
type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Create issue type screen scheme
* Creates an issue type screen scheme.
**[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
export async function main(
auth: Jira,
body: {
description?: string;
issueTypeMappings: { issueTypeId: string; screenSchemeId: string }[];
name: string;
}
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issuetypescreenscheme`
);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 879 days ago