Migrate Jira search from removed /rest/api/3/search to /rest/api/3/se… - #7106
Conversation
PR Reviewer Guide 🔍(Review updated until commit 849b105)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 849b105 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 681baad
Suggestions up to commit e9e6db4
|
| SearchResults mockSearchResults = mock(SearchResults.class); | ||
| doReturn("http://mock-service.jira.com/").when(authConfig).getUrl(); | ||
| doReturn(new ResponseEntity<>(mockSearchResults, HttpStatus.OK)).when(restTemplate).getForEntity(any(URI.class), any(Class.class)); | ||
| SearchResults results = jiraRestClient.getAllIssues(jql, "some-token-value"); |
There was a problem hiding this comment.
can we verify builder.queryParam(NEXT_PAGE_TOKEN, nextPageToken) call called ?
There was a problem hiding this comment.
Good catch, will add the verification
| doReturn(mockSearchResults).when(jiraRestClient).getAllIssues(any(StringBuilder.class), anyInt()); | ||
| when(jiraRestClient.getAllIssues(any(StringBuilder.class), any())) | ||
| .thenReturn(firstPage) | ||
| .thenReturn(secondPage); |
There was a problem hiding this comment.
can we verify searchIssues.getNextPageToken() was called multiple times ?
There was a problem hiding this comment.
Good catch, will add the verification.
…arch/jql Closes opensearch-project#7104 Signed-off-by: Harsha Siva Sai Sannapaneni <sivasais@amazon.com>
e9e6db4 to
681baad
Compare
|
Persistent review updated to latest commit 681baad |
Signed-off-by: Harsha Siva Sai Sannapaneni <sivasais@amazon.com>
|
Persistent review updated to latest commit 849b105 |
Migrate Jira search from removed /rest/api/3/search to /rest/api/3/search/jql
Closes #7104
Description
Atlassian permanently removed the
/rest/api/3/searchendpoint (CHANGE-2046, effective May 1, 2025). All Jira Cloud instances now return HTTP 410 GONE for this endpoint. This change migrates the Jira source plugin to the replacement/rest/api/3/search/jqlendpoint.Key changes:
rest/api/3/searchtorest/api/3/search/jqlstartAt) to cursor-based (nextPageToken) pagination per the new API contractnextPageTokenandisLastfields to theSearchResultsmodelJiraServiceto use cursor-based iterationIssues Resolved
Closes #7104
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.