type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Get issue link
* Returns an issue link.
This operation can be accessed anonymously.
**[Permissions](#permissions) required:**
* *Browse project* [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the linked issues.
* If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the issues.
*/
export async function main(auth: Jira, linkId: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issueLink/${linkId}`
);
const response = await fetch(url, {
method: "GET",
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;
};
/**
* Get issue link
* Returns an issue link.
This operation can be accessed anonymously.
**[Permissions](#permissions) required:**
* *Browse project* [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the linked issues.
* If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the issues.
*/
export async function main(auth: Jira, linkId: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issueLink/${linkId}`
);
const response = await fetch(url, {
method: "GET",
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