@SuppressWarnings("unused") private static void tryGetAllIssues(IssueManager issueManager) throws Exception { List<Issue> issues = issueManager.getIssues(projectKey, null); for (Issue issue : issues) { logger.debug(issue.toString()); } }
private void retrieveUnresolvedIssues(IssueManager issueManager, IssueHandler handler) { Iterator<Issue> issues = issueManager.allIssuesIterator(); while (issues.hasNext()) { Issue issue = issues.next(); if (issue.isUnresolved()) { handler.accept(issue); } } }
@SuppressWarnings("unused") private static void tryUpload( RedmineManager mgr, IssueManager issueManager, AttachmentManager attachmentManager) throws RedmineException, IOException { final byte[] content = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; final Attachment attach1 = attachmentManager.uploadAttachment("test.bin", "application/ternary", content); final Issue testIssue = new Issue(); testIssue.setSubject("This is upload ticket!"); testIssue.addAttachment(attach1); final Project tmpProject = ProjectFactory.create("Upload project", "uploadtmpproject"); final Project project = mgr.getProjectManager().createProject(tmpProject); try { final Issue createdIssue = issueManager.createIssue(project.getIdentifier(), testIssue); try { System.out.println(createdIssue.getAttachments()); } finally { issueManager.deleteIssue(createdIssue.getId()); } } finally { mgr.getProjectManager().deleteProject(project.getIdentifier()); } }
@SuppressWarnings("unused") private static void changeIssueStatus(IssueManager issueManager) throws RedmineException { Issue issue = issueManager.getIssueById(1771); issue.setSubject("new"); issueManager.update(issue); }
@SuppressWarnings("unused") private static void tryGetIssue(IssueManager issueManager) throws Exception { Issue issue = issueManager.getIssueById(3205, Include.journals, Include.relations, Include.attachments); System.out.println(issue.getJournals()); }
@SuppressWarnings("unused") private static void getIssueWithRelations(IssueManager issueManager) throws RedmineException { Issue issue = issueManager.getIssueById(22751, Include.relations); Collection<IssueRelation> r = issue.getRelations(); logger.debug("Retrieved relations " + r); }
@SuppressWarnings("unused") private static void getSavedQueries(IssueManager mgr) throws RedmineException { List<SavedQuery> savedQueries = mgr.getSavedQueries("test"); System.out.println(savedQueries.size()); logger.debug("Retrieved queries " + savedQueries); }
@SuppressWarnings("unused") private static void tryCreateRelation(IssueManager issueManager) throws RedmineException { IssueRelation r = issueManager.createRelation(49, 50, IssueRelation.TYPE.precedes.toString()); logger.debug("Created relation " + r); }
@SuppressWarnings("unused") private static void getStatuses(IssueManager mgr) throws RedmineException { mgr.getStatuses(); }