Skip to content

Commit 10fbf60

Browse files
committed
fix: use resolved org in numeric issue ID 404 hint (CLI-BT)
When a numeric issue ID lookup fails, the error hint showed '<org>' placeholder even when the org was already resolved from DSN/config. Now uses the actual org slug when available, making the hint directly copy-pasteable. Affects 18 users (CLI-BT).
1 parent 6a60754 commit 10fbf60

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/commands/issue/utils.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,7 @@ function extractOrgFromPermalink(
471471
async function resolveNumericIssue(
472472
id: string,
473473
cwd: string,
474-
command: string,
475-
commandHint: string
474+
command: string
476475
): Promise<ResolvedIssueResult> {
477476
const resolvedOrg = await resolveOrg({ cwd });
478477
try {
@@ -488,8 +487,11 @@ async function resolveNumericIssue(
488487
if (err instanceof ApiError && err.status === 404) {
489488
// Improve on the generic "Issue not found" message by including the ID
490489
// and suggesting the short-ID format, since users often confuse numeric
491-
// group IDs with short-ID suffixes.
492-
throw new ResolutionError(`Issue ${id}`, "not found", commandHint, [
490+
// group IDs with short-ID suffixes. When org context is available, use
491+
// the real org slug instead of <org> placeholder (CLI-BT, 18 users).
492+
const orgHint = resolvedOrg?.org ?? "<org>";
493+
const hint = `sentry issue ${command} ${orgHint}/${id}`;
494+
throw new ResolutionError(`Issue ${id}`, "not found", hint, [
493495
`No issue with numeric ID ${id} found — you may not have access, or it may have been deleted.`,
494496
`If this is a short ID suffix, try: sentry issue ${command} <project>-${id}`,
495497
]);
@@ -524,7 +526,7 @@ export async function resolveIssue(
524526

525527
switch (parsed.type) {
526528
case "numeric":
527-
return resolveNumericIssue(parsed.id, cwd, command, commandHint);
529+
return resolveNumericIssue(parsed.id, cwd, command);
528530

529531
case "explicit": {
530532
// Full context: org + project + suffix

0 commit comments

Comments
 (0)