public ArrayList<IssueHistory> getIssueChangeLog(Issue issue) throws JiraException { try { ArrayList<IssueHistory> changes = null; JSON response = getNextPortion(issue, 0); while (true) { JSONObject object = JSONObject.fromObject(response); Object opers = object.get("changelog"); object = JSONObject.fromObject(opers); Integer totalObj = (Integer)object.get("total"); JSONArray histories = JSONArray.fromObject(object.get("histories")); if (changes == null) { changes = new ArrayList<IssueHistory>(totalObj); } for (int i = 0; i < histories.size(); i++) { JSONObject p = histories.getJSONObject(i); changes.add(new IssueHistory(restclient, p)); } if (changes.size() >= totalObj) { break; } else { response = getNextPortion(issue,changes.size()); } } return changes; } catch (Exception ex) { throw new JiraException(ex.getMessage(), ex); } }