Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/main/java/net/rcarz/jiraclient/Issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,22 +632,28 @@ private List<Issue> getNextIssues() throws JiraException {
}

JSON result = null;
int tryCount = 0;

while (result == null && tryCount++ <= 10) {
try {
URI searchUri = createSearchURI(restclient, jql, includedFields,
expandFields, maxResults, startAt);
result = restclient.get(searchUri);
} catch (Exception ex) {
throw new JiraException("Failed to search issues", ex);
}
}

try {
URI searchUri = createSearchURI(restclient, jql, includedFields,
expandFields, maxResults, startAt);
result = restclient.get(searchUri);
} catch (Exception ex) {
throw new JiraException("Failed to search issues", ex);
if (result == null) {
throw new JiraException("JSON payload is null");
}

if (!(result instanceof JSONObject)) {
throw new JiraException("JSON payload is malformed");
}


Map map = (Map) result;

this.startAt = Field.getInteger(map.get("startAt"));
this.maxResults = Field.getInteger(map.get("maxResults"));
this.total = Field.getInteger(map.get("total"));
Expand Down