0

List a projects issues

by
Published Oct 17, 2025

**Deprecated**: This endpoint has been replaced with the Organization Issues endpoint which supports filtering on project and additional functionality.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * List a projects issues
4
 * **Deprecated**: This endpoint has been replaced with the Organization Issues endpoint which
5
supports filtering on project and additional functionality.
6
 */
7
export async function main(
8
	auth: RT.Sentry,
9
	project_id_or_slug: string,
10
	statsPeriod?: string | undefined,
11
	shortIdLookup?: string | undefined,
12
	query?: string | undefined,
13
	hashes?: string | undefined,
14
	cursor?: string | undefined
15
) {
16
	const url = new URL(
17
		`https://${auth.region}.sentry.io/api/0/projects/${auth.organizationSlug}/${project_id_or_slug}/issues/`
18
	)
19
	for (const [k, v] of [
20
		['statsPeriod', statsPeriod],
21
		['shortIdLookup', shortIdLookup],
22
		['query', query],
23
		['hashes', hashes],
24
		['cursor', cursor]
25
	]) {
26
		if (v !== undefined && v !== '') {
27
			url.searchParams.append(k, v)
28
		}
29
	}
30
	const response = await fetch(url, {
31
		method: 'GET',
32
		headers: {
33
			Authorization: 'Bearer ' + auth.token
34
		},
35
		body: undefined
36
	})
37
	if (!response.ok) {
38
		const text = await response.text()
39
		throw new Error(`${response.status} ${text}`)
40
	}
41
	return await response.json()
42
}
43