@Test public void testSprints(){ String boarId = "15493"; List<Sprint> sprints = jiraGhClient.sprints(boarId); Assert.assertTrue(sprints.size()>0); }
public List<Sprint> sprints(String boardId) { try { HttpGet httpGet = new HttpGet(JiraGhHttpHelper.sprintsUri(boardId)); HttpResponse httpResponse = request(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200) { throw new BentenJiraException(httpResponse.getStatusLine().getReasonPhrase()); } String json = EntityUtils .toString(httpResponse.getEntity()); JSONObject jsonObject= objectMapper.readValue(json, JSONObject.class); if(!JiraConverter.isNull(jsonObject.get("sprints"))){ List<Sprint> sprints = objectMapper.readValue(jsonObject.get("sprints").toString(),new TypeReference<List<Sprint>>(){}); if(!sprints.isEmpty()) return sprints; } return null; }catch(Exception e ){ logger.error(e.getMessage(),e); throw new BentenJiraException(e.getMessage()); } }
JiraGhClient extends BentenHttpClient { public List<Sprint> sprints(String boardId) { try { HttpGet httpGet = new HttpGet(JiraGhHttpHelper.sprintsUri(boardId)); HttpResponse httpResponse = request(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200) { throw new BentenJiraException(httpResponse.getStatusLine().getReasonPhrase()); } String json = EntityUtils .toString(httpResponse.getEntity()); JSONObject jsonObject= objectMapper.readValue(json, JSONObject.class); if(!JiraConverter.isNull(jsonObject.get("sprints"))){ List<Sprint> sprints = objectMapper.readValue(jsonObject.get("sprints").toString(),new TypeReference<List<Sprint>>(){}); if(!sprints.isEmpty()) return sprints; } return null; }catch(Exception e ){ logger.error(e.getMessage(),e); throw new BentenJiraException(e.getMessage()); } } }
JiraGhClient extends BentenHttpClient { public List<Sprint> sprints(String boardId) { try { HttpGet httpGet = new HttpGet(JiraGhHttpHelper.sprintsUri(boardId)); HttpResponse httpResponse = request(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200) { throw new BentenJiraException(httpResponse.getStatusLine().getReasonPhrase()); } String json = EntityUtils .toString(httpResponse.getEntity()); JSONObject jsonObject= objectMapper.readValue(json, JSONObject.class); if(!JiraConverter.isNull(jsonObject.get("sprints"))){ List<Sprint> sprints = objectMapper.readValue(jsonObject.get("sprints").toString(),new TypeReference<List<Sprint>>(){}); if(!sprints.isEmpty()) return sprints; } return null; }catch(Exception e ){ logger.error(e.getMessage(),e); throw new BentenJiraException(e.getMessage()); } }  }
JiraGhClient extends BentenHttpClient { public List<Sprint> sprints(String boardId) { try { HttpGet httpGet = new HttpGet(JiraGhHttpHelper.sprintsUri(boardId)); HttpResponse httpResponse = request(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200) { throw new BentenJiraException(httpResponse.getStatusLine().getReasonPhrase()); } String json = EntityUtils .toString(httpResponse.getEntity()); JSONObject jsonObject= objectMapper.readValue(json, JSONObject.class); if(!JiraConverter.isNull(jsonObject.get("sprints"))){ List<Sprint> sprints = objectMapper.readValue(jsonObject.get("sprints").toString(),new TypeReference<List<Sprint>>(){}); if(!sprints.isEmpty()) return sprints; } return null; }catch(Exception e ){ logger.error(e.getMessage(),e); throw new BentenJiraException(e.getMessage()); } }  List<Sprint> sprints(String boardId); SprintReport sprintReport(String boardId,String sprintId); }
JiraGhClient extends BentenHttpClient { public List<Sprint> sprints(String boardId) { try { HttpGet httpGet = new HttpGet(JiraGhHttpHelper.sprintsUri(boardId)); HttpResponse httpResponse = request(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200) { throw new BentenJiraException(httpResponse.getStatusLine().getReasonPhrase()); } String json = EntityUtils .toString(httpResponse.getEntity()); JSONObject jsonObject= objectMapper.readValue(json, JSONObject.class); if(!JiraConverter.isNull(jsonObject.get("sprints"))){ List<Sprint> sprints = objectMapper.readValue(jsonObject.get("sprints").toString(),new TypeReference<List<Sprint>>(){}); if(!sprints.isEmpty()) return sprints; } return null; }catch(Exception e ){ logger.error(e.getMessage(),e); throw new BentenJiraException(e.getMessage()); } }  List<Sprint> sprints(String boardId); SprintReport sprintReport(String boardId,String sprintId);  }