1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export const fetchAllUnresolvedJiraIssues = async (token: string, name: string) => {
const BASE_LINK = "https://ramen-inter.zaihui.com.cn/rest/api";
interface Resp {
expand: string;
startAt: number;
maxResults: number;
total: number;
issues: Issue[];
}
interface Issue {
expand: string;
id: string;
self: string;
key: string;
}
const resp: Resp = await fetchJSON(
`${BASE_LINK}/2/search?jql=project = SVC AND resolution = Unresolved AND assignee = ${name}&fields=id,key`,
{
bearer: token,
},
);
return resp.issues;
};