Jira "Issue key not found in commit/branch" in CI
A CI step parses the branch name, commit message, or PR title for a PROJECT-123 pattern to drive Jira automation. When nothing matches, the step reports the key as not found and downstream Jira steps have nothing to act on.
What this error means
The pipeline logs "Issue key not found in commit/branch" (or an empty key output) and later Jira steps skip or fail because no key was resolved.
Searching commit and branch for issue key...
No issue key found in branch 'fix/login-bug' or commit 'patch login timeout'Common causes
The branch and commit contain no issue key
The branch was created without the key and the commit message never mentions ABC-123, so the regex finds nothing.
The key format does not match the pattern
A lowercase key or a nonstandard separator does not match a [A-Z]+-[0-9]+ regex, so a present key is still missed.
How to fix it
Search multiple sources and normalize
- Match against the branch, the commit message, and the PR title.
- Use a case-insensitive regex and uppercase the result.
- Fail fast (or skip Jira steps) when no key is found.
KEY=$( (echo "$GITHUB_HEAD_REF"; git log -1 --pretty=%B) \
| grep -oiE '[a-z][a-z0-9]+-[0-9]+' | head -1 | tr '[:lower:]' '[:upper:]')
[ -z "$KEY" ] && echo "No issue key found" && exit 0Enforce keys in branch names
Require branches like ABC-123-short-desc via a naming policy so a key is always present to extract.
How to prevent it
- Require the Jira key in branch names or PR titles by policy.
- Match case-insensitively and normalize to uppercase.
- Skip Jira steps gracefully when no key is present.