type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Create issue link type
* Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The issue link type consists of a name and descriptions for a link's inward and outward relationships.
To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled.
**[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
export async function main(
auth: Jira,
body: {
id?: string;
inward?: string;
name?: string;
outward?: string;
self?: string;
}
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issueLinkType`
);
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;
};
/**
* Create issue link type
* Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The issue link type consists of a name and descriptions for a link's inward and outward relationships.
To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled.
**[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
export async function main(
auth: Jira,
body: {
id?: string;
inward?: string;
name?: string;
outward?: string;
self?: string;
}
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issueLinkType`
);
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