fix(init): fall back to project issueTypes when createmeta is unavail…#992
Open
skatrych wants to merge 2 commits into
Open
fix(init): fall back to project issueTypes when createmeta is unavail…#992skatrych wants to merge 2 commits into
skatrych wants to merge 2 commits into
Conversation
added 2 commits
May 6, 2026 15:34
…able
When the Metadata (createmeta) endpoint returns 401/403/404 during `jira init`,
use `GET /project/{key}?expand=issueTypes` to populate configured issue types
and allow init to complete.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem statement
In some corporate Jira Data Center deployments, the Jira REST metadata endpoint GET /rest/api/2/issue/createmeta is restricted/disabled (commonly returning 401/403/404). Today jira init treats this call as mandatory, so init fails even though the instance is otherwise usable.
What’s changing
jira init now uses a fallback strategy for configuring issue types:
• It still tries the existing metadata call (createmeta) first.
• If that call fails with 401/403/404, it falls back to:
• GET /rest/api/2/project/{projectKey}?expand=issueTypes
• The response is used to populate issue.types in the generated config, allowing jira init to complete successfully.
A warning is printed to make it clear the metadata endpoint is failing and that the alternative endpoint is being used.
Why this approach
• project?expand=issueTypes is commonly allowed in locked-down DC environments.
• It provides enough information to populate issue.types for interactive flows (e.g. issue type selection) even when createmeta is blocked.
• It avoids introducing new permissions requirements.
Notes / limitations
• This fallback does not provide create-screen required-field metadata (which createmeta can provide). Jira will still enforce required fields at create time.
Test plan
• go test ./...