@Override
  public Task[] getIssues(@Nullable String query, int max, long since) throws Exception {
    String url = "/projects/" + myProjectId + "/tickets.xml";
    url += "?q=" + encodeUrl("state:open sort:updated ");
    if (!StringUtil.isEmpty(query)) {
      url += encodeUrl(query);
    }
    final List<Task> tasks = new ArrayList<>();
    int page = 1;
    final HttpClient client = login();
    while (tasks.size() < max) {
      HttpMethod method = doREST(url + "&page=" + page, false, client);
      InputStream stream = method.getResponseBodyAsStream();
      Element element = new SAXBuilder(false).build(stream).getRootElement();
      if ("nil-classes".equals(element.getName())) break;
      if (!"tickets".equals(element.getName())) {
        LOG.warn("Error fetching issues for: " + url + ", HTTP status code: " + method.getStatusCode());
        throw new Exception("Error fetching issues for: " + url + ", HTTP status code: " + method.getStatusCode() +
                          "\n" + element.getText());
      }

      List<Element> children = element.getChildren("ticket");

      List<Task> taskList = ContainerUtil.mapNotNull(children, (NullableFunction<Element, Task>)o -> createIssue(o));
      tasks.addAll(taskList);
      page++;
    }
    return tasks.toArray(Task.EMPTY_ARRAY);
  }
@Override
  public Task[] getIssues(@Nullable String query, int max, long since)