Project

General

Profile

To do #1493

Need clarification on whether Sprints can be accessed by remine APIs

Added by Shaik Jafer Ali over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Estimated time:
Blocked:
No
Milestones:
Sprint:

Description

I use the remdine APIs to access the data.I am unable to get the "Sprint" field data. Please let me know whether I am missing on some point. Thanks.

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        // TODO Auto-generated method stub
        String uri = "http://xxxxx/xxx/";
        String apiAccessKey = "xxxxx";
        String projectKey = "xxxx";
        Integer queryId = null; // any

        RedmineManager mgr = RedmineManagerFactory.createWithApiKey(uri, apiAccessKey);
        IssueManager issueManager = mgr.getIssueManager();

        ResultsWrapper<Issue> issues = null;

        try {
        //    issues = issueManager.getIssues(projectKey, queryId);

            Params p1 = new Params();
            p1.add("set_filter", "1");
            p1.add("project_id", "17");
            p1.add("offset", "0");
            p1.add("limit", "300");
          //  p1.add("f[]", "nil");
            p1.add("c[]", "sprint");
            p1.add("c[]", "tracker");
            p1.add("c[]", "subject");
            p1.add("c[]", "priority");
            p1.add("c[]", "assigned_to");
            p1.add("c[]", "estimated_hours");
            p1.add("c[]", "spent_hours");
            p1.add("c[]", "pending_effort");
            p1.add("c[]", "due_date");
            p1.add("c[]", "done_ratio");
            p1.add("c[]", "status");
            p1.add("group_by", "tracker");

            issues = issueManager.getIssues(p1);

            //issueManager.getIssueById(id, Include.journals);
            //System.out.println(issues.size());
        } catch (RedmineException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        for (Issue issue : issues.getResults()) {
            System.out.println("Issue id : " + issue.getId() );
            try {
                issue = issueManager.getIssueById(issue.getId(), Include.journals);
            } catch (RedmineException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            System.out.println("Project : " + issue.getProjectName() );
            System.out.println("Sprint : " + issue.getCustomFieldByName("sprint") );
            System.out.println("Journals :" + issue.getJournals());
            System.out.println("Relations: " + issue.getRelations());
            System.out.println("tracker : " + issue.getTracker().getName() );
            System.out.println("subject : " + issue.getSubject() );
            System.out.println("priority : " + issue.getPriorityText() );
            System.out.println("Assignee" + issue.getAssigneeName() );
            System.out.println("Estimated hrs : " + issue.getEstimatedHours() );
            System.out.println("Spent hrs : " + issue.getSpentHours() );
            System.out.println("Due date : " + issue.getDueDate() );
            System.out.println("Done ratio : " + issue.getDoneRatio() );
            Collection<CustomField>flds = issue.getCustomFields();

    }

}

No data to display

Also available in: Atom PDF