type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Delete issue field option
* Deletes an option from a select list issue field.
*/
export async function main(auth: Jira, fieldKey: string, optionId: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/field/${fieldKey}/option/${optionId}`
);
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;
};
/**
* Delete issue field option
* Deletes an option from a select list issue field.
*/
export async function main(auth: Jira, fieldKey: string, optionId: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/field/${fieldKey}/option/${optionId}`
);
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 948 days ago