[Bug][Jira] V2 API removed #8563#8608
Conversation
Thank you for the PR! However, during the testing process, I discovered a potential issue: |
…rison - Replace strings.ToLower(deploymentType) == constant with strings.EqualFold - Fixes issue where case-insensitive comparison was only converting one side - Update tests to reflect the new comparison logic using strings.EqualFold - Affects epic_collector.go and issue_collector.go
5410208 to
9dd0315
Compare
|
Thank you for catching it, @GoSimplicity. Please review again. |
|
LGTM |
Summary
What does this PR do?
This PR fixes a case sensitivity issue in the Jira plugin's deployment type detection that caused API endpoint selection errors. The Jira API returns deployment types as "Cloud" or "Server" (capitalized), but the code was performing case-sensitive comparisons against lowercase constants, causing Jira Cloud instances to incorrectly use the deprecated v2 API endpoint instead of the v3 API.
Changes:
strings.ToLower()stringsimport inissue_collector.goFiles Modified:
backend/plugins/jira/tasks/account_collector.gobackend/plugins/jira/tasks/epic_collector.gobackend/plugins/jira/tasks/issue_changelog_collector.gobackend/plugins/jira/tasks/issue_changelog_extractor.gobackend/plugins/jira/tasks/issue_collector.gobackend/plugins/jira/tasks/issue_comment_collector.gobackend/plugins/jira/tasks/issue_comment_extractor.gobackend/plugins/jira/tasks/issue_type_collector.gobackend/plugins/jira/tasks/sprint_extractor.gobackend/plugins/jira/tasks/deployment_type_test.go(new)Does this close any open issues?
[Bug][Jira] V2 API removed #8563
Fixes the error:
The requested API has been removed. Please migrate to the /rest/api/3/search/jql APIwhen collecting Jira Cloud epics.This error occurred because the deployment type comparison was case-sensitive, causing Jira Cloud instances (which return "Cloud") to be treated as Jira Server and use the deprecated
/api/2/searchendpoint instead of/api/3/search/jql.Screenshots
N/A - This is a backend API endpoint selection fix.
Other Information