type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Get is watching issue bulk
* Returns, for the user, details of the watched status of issues from a list.
*/
export async function main(auth: Jira, body: { issueIds: string[] }) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issue/watching`
);
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 396 days ago
type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Get is watching issue bulk
* Returns, for the user, details of the watched status of issues from a list.
*/
export async function main(auth: Jira, body: { issueIds: string[] }) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issue/watching`
);
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 948 days ago