Skip to content

fix(init): fall back to project issueTypes when createmeta is unavail…#992

Open
skatrych wants to merge 2 commits into
ankitpokhrel:mainfrom
skatrych:fix/jira-init-metadata-fallback
Open

fix(init): fall back to project issueTypes when createmeta is unavail…#992
skatrych wants to merge 2 commits into
ankitpokhrel:mainfrom
skatrych:fix/jira-init-metadata-fallback

Conversation

@skatrych

@skatrych skatrych commented May 6, 2026

Copy link
Copy Markdown

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 ./...

Sergii Katrych 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant