@Test public void testGetPossibleTransitions() throws JsonProcessingException { String issueKey = "PSAA-1009"; List<Transition> transitions = jiraHttpClient.getPossibleTransitions(issueKey); }
public List<Transition> getPossibleTransitions(String issueKey){ try { HttpGet httpGet = new HttpGet(JiraHttpHelper.possibleTransitionsUri(issueKey)); HttpResponse httpResponse = request(httpGet); if(httpResponse.getStatusLine().getStatusCode()!=200){ handleJiraException(httpResponse); } String json = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObject = JiraConverter.objectMapper .readValue(json,JSONObject.class); List<Transition> transitions= JiraConverter.objectMapper .readValue(jsonObject.get("transitions").toString(),new TypeReference<List<Transition>>(){}); return transitions; }catch (Exception ex) { throw new RuntimeException(ex); } }
JiraHttpClient extends BentenHttpClient { public List<Transition> getPossibleTransitions(String issueKey){ try { HttpGet httpGet = new HttpGet(JiraHttpHelper.possibleTransitionsUri(issueKey)); HttpResponse httpResponse = request(httpGet); if(httpResponse.getStatusLine().getStatusCode()!=200){ handleJiraException(httpResponse); } String json = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObject = JiraConverter.objectMapper .readValue(json,JSONObject.class); List<Transition> transitions= JiraConverter.objectMapper .readValue(jsonObject.get("transitions").toString(),new TypeReference<List<Transition>>(){}); return transitions; }catch (Exception ex) { throw new RuntimeException(ex); } } }
JiraHttpClient extends BentenHttpClient { public List<Transition> getPossibleTransitions(String issueKey){ try { HttpGet httpGet = new HttpGet(JiraHttpHelper.possibleTransitionsUri(issueKey)); HttpResponse httpResponse = request(httpGet); if(httpResponse.getStatusLine().getStatusCode()!=200){ handleJiraException(httpResponse); } String json = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObject = JiraConverter.objectMapper .readValue(json,JSONObject.class); List<Transition> transitions= JiraConverter.objectMapper .readValue(jsonObject.get("transitions").toString(),new TypeReference<List<Transition>>(){}); return transitions; }catch (Exception ex) { throw new RuntimeException(ex); } }  }
JiraHttpClient extends BentenHttpClient { public List<Transition> getPossibleTransitions(String issueKey){ try { HttpGet httpGet = new HttpGet(JiraHttpHelper.possibleTransitionsUri(issueKey)); HttpResponse httpResponse = request(httpGet); if(httpResponse.getStatusLine().getStatusCode()!=200){ handleJiraException(httpResponse); } String json = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObject = JiraConverter.objectMapper .readValue(json,JSONObject.class); List<Transition> transitions= JiraConverter.objectMapper .readValue(jsonObject.get("transitions").toString(),new TypeReference<List<Transition>>(){}); return transitions; }catch (Exception ex) { throw new RuntimeException(ex); } }  List<Issue> searchIssues(String jql,String expandedFields,int maxResults); Issue getIssueDetails(String issueKey,String expandedFields); void updateIssue(String issueKey,Map<String,Object> fields); void logWork(String issueKey,JSONObject jsonObject); void transitionIssue(String issueKey,JSONObject jsonObject); List<Transition> getPossibleTransitions(String issueKey); void comment(String issueKey,JSONObject jsonObject); JSONObject getCreateMetaData(String projectKey, String issueType); String createIssue(Map<String,Object> fields); }
JiraHttpClient extends BentenHttpClient { public List<Transition> getPossibleTransitions(String issueKey){ try { HttpGet httpGet = new HttpGet(JiraHttpHelper.possibleTransitionsUri(issueKey)); HttpResponse httpResponse = request(httpGet); if(httpResponse.getStatusLine().getStatusCode()!=200){ handleJiraException(httpResponse); } String json = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObject = JiraConverter.objectMapper .readValue(json,JSONObject.class); List<Transition> transitions= JiraConverter.objectMapper .readValue(jsonObject.get("transitions").toString(),new TypeReference<List<Transition>>(){}); return transitions; }catch (Exception ex) { throw new RuntimeException(ex); } }  List<Issue> searchIssues(String jql,String expandedFields,int maxResults); Issue getIssueDetails(String issueKey,String expandedFields); void updateIssue(String issueKey,Map<String,Object> fields); void logWork(String issueKey,JSONObject jsonObject); void transitionIssue(String issueKey,JSONObject jsonObject); List<Transition> getPossibleTransitions(String issueKey); void comment(String issueKey,JSONObject jsonObject); JSONObject getCreateMetaData(String projectKey, String issueType); String createIssue(Map<String,Object> fields);  }