@Test public void testGet() { String ticketId = "NMS-1000"; Ticket newTicket = m_ticketer.get(ticketId); assertNotNull(newTicket); assertEquals(ticketId, newTicket.getId()); System.out.println(newTicket.getId() + ": " + newTicket.getSummary()); assertTrue("Unexpected summary: " + newTicket.getSummary(), newTicket.getSummary().startsWith("java.sql.SQLException")); assertEquals(Ticket.State.CLOSED, newTicket.getState()); assertTrue("Unexpected details: " + newTicket.getDetails(), newTicket.getDetails().startsWith("Ted Kaczmarek")); }
@Override public Ticket get(String ticketId) { JiraRestClient jira = getConnection(); if (jira == null) { return null; } Issue issue = jira.getIssueClient().getIssue(ticketId, new NullProgressMonitor()); if (issue != null) { Ticket ticket = new Ticket(); ticket.setId(issue.getKey()); ticket.setModificationTimestamp(String.valueOf(issue.getUpdateDate().toDate().getTime())); ticket.setSummary(issue.getSummary()); String allComments = ""; for (Comment comment : issue.getComments()) { allComments = allComments + "\n" + comment.getAuthor().getDisplayName() + "\n" + comment.getBody(); } ticket.setDetails(allComments.trim()); ticket.setState(getStateFromId(issue.getStatus().getName())); return ticket; } else { return null; } }
JiraTicketerPlugin implements Plugin { @Override public Ticket get(String ticketId) { JiraRestClient jira = getConnection(); if (jira == null) { return null; } Issue issue = jira.getIssueClient().getIssue(ticketId, new NullProgressMonitor()); if (issue != null) { Ticket ticket = new Ticket(); ticket.setId(issue.getKey()); ticket.setModificationTimestamp(String.valueOf(issue.getUpdateDate().toDate().getTime())); ticket.setSummary(issue.getSummary()); String allComments = ""; for (Comment comment : issue.getComments()) { allComments = allComments + "\n" + comment.getAuthor().getDisplayName() + "\n" + comment.getBody(); } ticket.setDetails(allComments.trim()); ticket.setState(getStateFromId(issue.getStatus().getName())); return ticket; } else { return null; } } }
JiraTicketerPlugin implements Plugin { @Override public Ticket get(String ticketId) { JiraRestClient jira = getConnection(); if (jira == null) { return null; } Issue issue = jira.getIssueClient().getIssue(ticketId, new NullProgressMonitor()); if (issue != null) { Ticket ticket = new Ticket(); ticket.setId(issue.getKey()); ticket.setModificationTimestamp(String.valueOf(issue.getUpdateDate().toDate().getTime())); ticket.setSummary(issue.getSummary()); String allComments = ""; for (Comment comment : issue.getComments()) { allComments = allComments + "\n" + comment.getAuthor().getDisplayName() + "\n" + comment.getBody(); } ticket.setDetails(allComments.trim()); ticket.setState(getStateFromId(issue.getStatus().getName())); return ticket; } else { return null; } }  }
JiraTicketerPlugin implements Plugin { @Override public Ticket get(String ticketId) { JiraRestClient jira = getConnection(); if (jira == null) { return null; } Issue issue = jira.getIssueClient().getIssue(ticketId, new NullProgressMonitor()); if (issue != null) { Ticket ticket = new Ticket(); ticket.setId(issue.getKey()); ticket.setModificationTimestamp(String.valueOf(issue.getUpdateDate().toDate().getTime())); ticket.setSummary(issue.getSummary()); String allComments = ""; for (Comment comment : issue.getComments()) { allComments = allComments + "\n" + comment.getAuthor().getDisplayName() + "\n" + comment.getBody(); } ticket.setDetails(allComments.trim()); ticket.setState(getStateFromId(issue.getStatus().getName())); return ticket; } else { return null; } }  @Override Ticket get(String ticketId); @Override void saveOrUpdate(Ticket ticket); }
JiraTicketerPlugin implements Plugin { @Override public Ticket get(String ticketId) { JiraRestClient jira = getConnection(); if (jira == null) { return null; } Issue issue = jira.getIssueClient().getIssue(ticketId, new NullProgressMonitor()); if (issue != null) { Ticket ticket = new Ticket(); ticket.setId(issue.getKey()); ticket.setModificationTimestamp(String.valueOf(issue.getUpdateDate().toDate().getTime())); ticket.setSummary(issue.getSummary()); String allComments = ""; for (Comment comment : issue.getComments()) { allComments = allComments + "\n" + comment.getAuthor().getDisplayName() + "\n" + comment.getBody(); } ticket.setDetails(allComments.trim()); ticket.setState(getStateFromId(issue.getStatus().getName())); return ticket; } else { return null; } }  @Override Ticket get(String ticketId); @Override void saveOrUpdate(Ticket ticket);  }