//Query the defects collection
QueryRequest defectRequest = new QueryRequest(defectInfo);
defectRequest.setFetch(new Fetch("FormattedID", "Name", "State", "Priority"));
QueryResponse queryResponse = restApi.query(defectRequest);
if (queryResponse.wasSuccessful()) {
for (JsonElement result : queryResponse.getResults()) {
JsonObject defect = result.getAsJsonObject();
System.out.println(String.format("\t%s - %s: Priority=%s, State=%s",
defect.get("FormattedID").getAsString(),
defect.get("Name").getAsString(),