diff --git a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java index c7c30b76cb..9bee250331 100644 --- a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java +++ b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java @@ -14,6 +14,7 @@ import org.springframework.util.MultiValueMap; import org.springframework.web.client.HttpClientErrorException; import java.io.File; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -87,7 +88,19 @@ public abstract class JiraAbstractClient extends BaseClient { } public List getAssignableUser(String projectKey) { - String url = getBaseUrl() + "/user/assignable/search?project={1}&maxResults=" + 1000 + "&startAt=" + 0; + List res = new ArrayList<>(); + int maxResults = 1000, startAt = 0; + List list; + do { + list = this.getAssignableUser(startAt, maxResults, projectKey); + res.addAll(list); + startAt += maxResults; + } while (list.size() >= maxResults); + return res; + } + + private List getAssignableUser(int startAt, int maxResult, String projectKey) { + String url = getBaseUrl() + "/user/assignable/search?project={1}&maxResults=" + maxResult + "&startAt=" + startAt; ResponseEntity response = null; try { response = restTemplate.exchange(url, HttpMethod.GET, getAuthHttpEntity(), String.class, projectKey);