Jira Integration | Detect Cloud deployment via serverInfo API instead…#668
Closed
Chennoy wants to merge 4 commits into
Closed
Jira Integration | Detect Cloud deployment via serverInfo API instead…#668Chennoy wants to merge 4 commits into
Chennoy wants to merge 4 commits into
Conversation
katy-rotman-aqua
approved these changes
Apr 16, 2026
… of URL suffix Jira Cloud instances with custom domains (not ending in "atlassian.net") were misclassified as Server type deployement, causing user search and PAT validation to use the wrong API paths. Replaced the URL-based check with a /rest/api/2/serverInfo probe that reads the deploymentType field from the API. The URL check is kept as a fallback when the probe fails, preserving backward compatibility. Also refactored Init() to share a single client across the serverInfo probe and board fetch.
…instead of GetCreateMeta() for Jira Cloud Routed Cloud instances to GetCreateMetaWithOptionsWithContextForJira9() in createMetaProject(), bypassing the SDK's internal routing which uses the deprecated /rest/api/2/issue/createmeta endpoint. Also added debug logs in createMetaProject for troubleshooting.
Chennoy
force-pushed
the
fix/jira-deployment-check
branch
2 times, most recently
from
April 27, 2026 13:09
f2479a4 to
43f4fea
Compare
…irect calls to /issue/createmeta/{project}/issuetypes
The SDK's GetCreateMetaWithOptionsWithContextForJira9() method fetches issue types from /rest/api/2/project/{key}, which is not the recommended API to use. Atlassian's recommended replacement endpoints are:
- GET /rest/api/2/issue/createmeta/{project}/issuetypes
- GET /rest/api/2/issue/createmeta/{project}/issuetypes/{id}
The Server Jira remains unchanged and will still use GetCreateMeta(). Also updated InitIssue() to identify the project by key (instead of id/name) when metadata is fetched via the Cloud path.
Chennoy
force-pushed
the
fix/jira-deployment-check
branch
from
April 27, 2026 13:30
43f4fea to
da9333a
Compare
…sing SDK's broken routing
The SDK's c.Issue.GetCreateMeta() internally calls isJiraAPI9() which misroutes some Cloud instances (version 1001) to the Server-only endpoint /rest/api/2/project/{key}, causing 404 errors. Additionally, the per-project endpoint /issue/createmeta/{project}/issuetypes does not exist on Jira Cloud.
This replaces both approaches with a direct call to the correct Cloud endpoint: /rest/api/2/issue/createmeta?projectKeys={key}&expand=... using c.NewRequest/c.Do to bypass the SDK's internal routing entirely.
Contributor
Author
|
No need for these changes. |
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.
Jira Cloud instances with custom domains (not ending in "atlassian.net") were misclassified as Server type deployement, causing user search and PAT validation to use the wrong API paths. Replaced the URL-based check with a /rest/api/2/serverInfo probe that reads the deploymentType field from the API. The URL check is kept as a fallback when the probe fails, preserving backward compatibility. Also refactored Init() to share a single client across the serverInfo probe and board fetch.