@Test public void testTransitionIssue() throws JsonProcessingException { String issueKey = TestHelper.createStory(bentenJiraClient); TestHelper.updateAssigneeAndReporter(bentenJiraClient,issueKey); JSONObject transition = new JSONObject(); List<Transition> transitions = jiraHttpClient.getPossibleTransitions(issueKey); transition.put("transition",transitions.get(0)); jiraHttpClient.transitionIssue(issueKey,transition); }
public void transitionIssue(String issueKey,JSONObject jsonObject){ try { HttpPost httpPost = new HttpPost(JiraHttpHelper.possibleTransitionsUri(issueKey)); StringEntity stringEntity = formPayload(jsonObject); httpPost.setEntity(stringEntity); HttpResponse httpResponse = request(httpPost); if(httpResponse.getStatusLine().getStatusCode()!=204){ handleJiraException(httpResponse); } }catch (Exception ex) { throw new RuntimeException(ex); } }
JiraHttpClient extends BentenHttpClient { public void transitionIssue(String issueKey,JSONObject jsonObject){ try { HttpPost httpPost = new HttpPost(JiraHttpHelper.possibleTransitionsUri(issueKey)); StringEntity stringEntity = formPayload(jsonObject); httpPost.setEntity(stringEntity); HttpResponse httpResponse = request(httpPost); if(httpResponse.getStatusLine().getStatusCode()!=204){ handleJiraException(httpResponse); } }catch (Exception ex) { throw new RuntimeException(ex); } } }
JiraHttpClient extends BentenHttpClient { public void transitionIssue(String issueKey,JSONObject jsonObject){ try { HttpPost httpPost = new HttpPost(JiraHttpHelper.possibleTransitionsUri(issueKey)); StringEntity stringEntity = formPayload(jsonObject); httpPost.setEntity(stringEntity); HttpResponse httpResponse = request(httpPost); if(httpResponse.getStatusLine().getStatusCode()!=204){ handleJiraException(httpResponse); } }catch (Exception ex) { throw new RuntimeException(ex); } }  }
JiraHttpClient extends BentenHttpClient { public void transitionIssue(String issueKey,JSONObject jsonObject){ try { HttpPost httpPost = new HttpPost(JiraHttpHelper.possibleTransitionsUri(issueKey)); StringEntity stringEntity = formPayload(jsonObject); httpPost.setEntity(stringEntity); HttpResponse httpResponse = request(httpPost); if(httpResponse.getStatusLine().getStatusCode()!=204){ handleJiraException(httpResponse); } }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 void transitionIssue(String issueKey,JSONObject jsonObject){ try { HttpPost httpPost = new HttpPost(JiraHttpHelper.possibleTransitionsUri(issueKey)); StringEntity stringEntity = formPayload(jsonObject); httpPost.setEntity(stringEntity); HttpResponse httpResponse = request(httpPost); if(httpResponse.getStatusLine().getStatusCode()!=204){ handleJiraException(httpResponse); } }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);  }