fix(测试跟踪): 提交Jira缺陷时获取报告人不全
--bug=1010876 --user=李玉号 【测试跟踪】github#11176,关联jira后,一些信息拿不全,如关联需求,报告人等只有部分 https://www.tapd.cn/55049933/s/1117558 Closes #11176
This commit is contained in:
parent
7e726b36e1
commit
41686defa9
|
@ -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<JiraUser> getAssignableUser(String projectKey) {
|
||||
String url = getBaseUrl() + "/user/assignable/search?project={1}";
|
||||
List<JiraUser> list = new ArrayList<>();
|
||||
int maxResults = 50, startAt = 0;
|
||||
List<JiraUser> users;
|
||||
do {
|
||||
users = getAssignableUser(projectKey, startAt, maxResults);
|
||||
list.addAll(users);
|
||||
startAt += maxResults;
|
||||
} while (users.size() >= maxResults);
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<JiraUser> getAssignableUser(String projectKey, int startAt, int maxResults) {
|
||||
String url = getBaseUrl() + "/user/assignable/search?project={1}&maxResults=" + maxResults + "&startAt=" + startAt;
|
||||
ResponseEntity<String> response = null;
|
||||
try {
|
||||
response = restTemplate.exchange(url, HttpMethod.GET, getAuthHttpEntity(), String.class, projectKey);
|
||||
|
|
Loading…
Reference in New Issue