Jira REST "404 ... issue does not exist" (wrong key) in CI
Jira returns 404 with "Issue does not exist" when the key in the URL does not match a visible issue. The key may have the wrong project prefix, the wrong number, or point at a project the account cannot access.
What this error means
A call to /rest/api/3/issue/ABC-123 fails with 404 and "Issue does not exist or you do not have permission to see it." The rest of the API works.
HTTP/1.1 404 Not Found
{"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}Common causes
The issue key is wrong or built from bad input
A key parsed from a branch or commit is malformed, uses the wrong project prefix, or references a number that does not exist.
The account cannot see the project
Jira returns 404 (not 403) to hide existence, so a browse-permission gap looks identical to a missing issue.
How to fix it
Validate the key before using it
- Log the exact key the pipeline extracted and confirm the project prefix.
- Fetch the issue directly to distinguish a typo from a permission gap.
- Grant the account Browse Projects permission if the issue truly exists.
KEY=ABC-123
curl -sf -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
"https://your-domain.atlassian.net/rest/api/3/issue/$KEY?fields=key"Normalize keys extracted from Git
Uppercase the project prefix and strip stray characters so a branch like feature/abc-123-x yields a valid ABC-123.
KEY=$(echo "$BRANCH" | grep -oiE '[a-z]+-[0-9]+' | head -1 | tr '[:lower:]' '[:upper:]')How to prevent it
- Extract and validate the issue key early, and fail fast if empty.
- Uppercase project prefixes so key matching is case-consistent.
- Grant the CI account Browse Projects so 404-as-permission is ruled out.