This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.10.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.10.x by this push:
new 426215c3bd1 Revert "fix(jira): Fix querying issues on jira cloud
instance (#18513) (#19362)"
426215c3bd1 is described below
commit 426215c3bd142efba24bfb36767f88392180feaf
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Sep 29 15:40:56 2025 +0200
Revert "fix(jira): Fix querying issues on jira cloud instance (#18513)
(#19362)"
This reverts commit 52413105bfb9090a3ffb38b3a0cf0e136e5dd040.
---
.../component/jira/consumer/AbstractJiraConsumer.java | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git
a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java
b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java
index c9210811a5d..5329a1a64f4 100644
---
a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java
+++
b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java
@@ -26,7 +26,6 @@ import com.atlassian.jira.rest.client.api.RestClientException;
import com.atlassian.jira.rest.client.api.SearchRestClient;
import com.atlassian.jira.rest.client.api.domain.Issue;
import com.atlassian.jira.rest.client.api.domain.SearchResult;
-import
com.atlassian.jira.rest.client.internal.async.AsynchronousCloudSearchRestClient;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePropertyKey;
import org.apache.camel.Processor;
@@ -126,26 +125,18 @@ public abstract class AbstractJiraConsumer extends
ScheduledBatchPollingConsumer
Set<Issue> issues = new LinkedHashSet<>();
while (true) {
SearchRestClient searchRestClient =
endpoint.getClient().getSearchClient();
- // *navigable should be the default value, but it does not seem to
be true with 6.0.2 client
- SearchResult searchResult = searchRestClient.searchJql(jql,
maxPerQuery, start, Set.of("*navigable")).claim();
+ SearchResult searchResult = searchRestClient.searchJql(jql,
maxPerQuery, start, null).claim();
for (Issue issue : searchResult.getIssues()) {
issues.add(issue);
}
- // Note: the total # the query would return *without* pagination,
effectively telling us
+ // Note: #getTotal == the total # the query would return *without*
pagination, effectively telling us
// we've reached the end. Also exit early if we're limiting the #
of results or
// if total # of returned issues is lower than the actual page
size.
- int total;
- if (searchRestClient instanceof AsynchronousCloudSearchRestClient)
{
- // calling searchResult.getTotal() on
AsynchronousCloudSearchRestClient throws an exception:
- // Total is not available in the Cloud version of the new
Search API response.
- // Please use `SearchRestClient.totalCount` instead to fetch
the estimated count of the issues for a given JQL
- total = searchRestClient.totalCount(jql).claim().getCount();
- } else {
- total = searchResult.getTotal();
- }
- if (maxPerQuery >= total || start >= total || maxResults > 0 &&
issues.size() >= maxResults) {
+ if (maxPerQuery >= searchResult.getTotal() ||
+ start >= searchResult.getTotal() ||
+ maxResults > 0 && issues.size() >= maxResults) {
break;
}