type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Get issue property keys
* Returns the URLs and keys of an issue's properties.
This operation can be accessed anonymously.
**[Permissions](#permissions) required:** Property details are only returned where the user has:
* *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue.
* If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.
*/
export async function main(auth: Jira, issueIdOrKey: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issue/${issueIdOrKey}/properties`
);
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 property keys
* Returns the URLs and keys of an issue's properties.
This operation can be accessed anonymously.
**[Permissions](#permissions) required:** Property details are only returned where the user has:
* *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue.
* If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.
*/
export async function main(auth: Jira, issueIdOrKey: string) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/issue/${issueIdOrKey}/properties`
);
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