Пример #1
0
 @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);
      }
    }
  }
Пример #3
0
 @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());
   }
 }
Пример #4
0
 @SuppressWarnings("unused")
 private static void changeIssueStatus(IssueManager issueManager) throws RedmineException {
   Issue issue = issueManager.getIssueById(1771);
   issue.setSubject("new");
   issueManager.update(issue);
 }
Пример #5
0
 @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());
 }
Пример #6
0
 @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);
 }
Пример #7
0
 @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);
 }
Пример #8
0
 @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);
 }
Пример #9
0
 @SuppressWarnings("unused")
 private static void getStatuses(IssueManager mgr) throws RedmineException {
   mgr.getStatuses();
 }