private String getSummary(String number) throws ServiceException, IOException { JiraSoapService svc = new JiraSoapServiceServiceLocator().getJirasoapserviceV2(new URL("http://issues.jenkins-ci.org/rpc/soap/jirasoapservice-v2")); ConnectionInfo con = new ConnectionInfo(); String token = svc.login(con.userName, con.password); RemoteIssue issue = svc.getIssue(token, "JENKINS-" + number); return String.format("%s:%s (%s) %s", issue.getKey(), issue.getSummary(), findStatus(svc,token,issue.getStatus()).getName(), "http://jenkins-ci.org/issue/"+number); }
private RemoteStatus findStatus(JiraSoapService svc, String token, String statusId) throws RemoteException { RemoteStatus[] statuses = svc.getStatuses(token); for (RemoteStatus s : statuses) if(s.getId().equals(statusId)) return s; return null; }