Skip to content

Jira Integration | Detect Cloud deployment via serverInfo API instead…#668

Closed
Chennoy wants to merge 4 commits into
aquasecurity:postee-for-enterprisefrom
Chennoy:fix/jira-deployment-check
Closed

Jira Integration | Detect Cloud deployment via serverInfo API instead…#668
Chennoy wants to merge 4 commits into
aquasecurity:postee-for-enterprisefrom
Chennoy:fix/jira-deployment-check

Conversation

@Chennoy

@Chennoy Chennoy commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

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.

Chennoy added 2 commits April 27, 2026 10:59
… 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
Chennoy force-pushed the fix/jira-deployment-check branch 2 times, most recently from f2479a4 to 43f4fea Compare April 27, 2026 13:09
…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
Chennoy force-pushed the fix/jira-deployment-check branch from 43f4fea to da9333a Compare April 27, 2026 13:30
…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.
@Chennoy Chennoy closed this May 4, 2026
@Chennoy

Chennoy commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

No need for these changes.

@Chennoy
Chennoy deleted the fix/jira-deployment-check branch May 4, 2026 12:04
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.

2 participants