Project

General

Profile

How to get all the issues with Java Api - I didn't get all the issues following the doc - Java API Redmine

Added by VICTOR LOPEZ almost 6 years ago

Hi,

I am using the next:
Redmine version 3.1.0.stable
Ruby version 2.0.0-p645 (2015-04-13) [x86_64-linux]
Rails version 4.2.3
Environment production
Database adapter Mysql2

I am trying to get all the issues that is my Redmine and I cannot do it. Here is the code that I use.

  final Map<String, String> params = new HashMap<String, String>();

        params.put("project_id", Integer.toString(projectId));
        params.put("status_id", "*");

         List<Issue> issues1 = mgr.getIssueManager().getIssues(params).getResults();
            for (Issue issue : issues1) {
                                     System.out.println(" estado " + issue.getStatusName() + " prioridad " + 
              issue.getPriorityText() + " name: " +issue.getTracker().getName() + " subject: "+ issue.getSubject());}

But I dont get all the issues, I just got the open issues.

Btw, I have also tried

final Map<String, String> params = new HashMap<String, String>();

        params.put("project_id", Integer.toString(projectId));
        params.put("status_id", "closed");

         List<Issue> issues1 = mgr.getIssueManager().getIssues(params).getResults();
            for (Issue issue : issues1) {
                                     System.out.println(" estado " + issue.getStatusName() + " prioridad " + 
              issue.getPriorityText() + " name: " +issue.getTracker().getName() + " subject: "+ issue.getSubject());}

But I dont get all the closed cases, just some of them.

Someone could help me?

Thanks.

Replies (3)

RE: How to get all the issues with Java Api - I didn't get all the issues following the doc - Java API Redmine - Added by VICTOR LOPEZ almost 6 years ago

I see that the maximun issues number that I get with this code is 25.

Someone can help me?

Thanks!

RE: How to get all the issues with Java Api - I didn't get all the issues following the doc - Java API Redmine - Added by Alex Last about 5 years ago

you can set page size:

RedmineManager mgr = RedmineManagerFactory.createWithApiKey(uri, apiAccessKey);
// override default page size if needed
mgr.setObjectsPerPage(100);

RE: How to get all the issues with Java Api - I didn't get all the issues following the doc - Java API Redmine - Added by Sai Datta Vishnubhotla Krishna about 5 years ago

Hi,

Fetch separate lists using different status codes.
For fetching list(list1) of closed issues use: params.put("status_id", "5");
For fetching list(list2) of open issues use: params.put("status_id", "1");

Then finally you can combine the lists using list1.addAll(list2)

    (1-3/3)