0

I am getting Redmine Issue with parameters.

I tried:

var rmMan = new RedmineManager(RedmineHost, RedmineKey);
rmMan.GetObjectList<Issue>(new NameValueCollection { { "parent_id", "1111" } }).Where(i=>i.Tracker.Name == "MyTrackerName");

How can I overcome this?

I want to get "Issue" object, found in the parameters without specifying Id. For example on the tracker.

Brandon
  • 4,491
  • 6
  • 38
  • 59
Fortudie
  • 21
  • 8
  • What are you asking? Are you trying to get issue #1111? – Brandon May 10 '16 at 18:17
  • @Brandon I'm trying to get (find) an object of type the parameters (not by number). I want to understand how to set the selection parameters. As in the example - this tracker. – Fortudie May 11 '16 at 13:50

1 Answers1

0

GetObjectList wont do any filtering unless you specify the parameters. It will get all objects of type Issue (in your case). Adding the Where clause does the filtering after you've selected everything. I'm not sure that your NameValueCollection using parent_id will do anything either and redmine-net-api has terrible documentation.

Try this:

var parameters = new NameValueCollection
{
    { "parent_id", "1111" },
    { "tracker", "MyTrackerName" },
}
var rmMan = new RedmineManager(RedmineHost, RedmineKey);

var issues = rmMan.GetObjectList<Issue>(parameters);

Again, since the redmine-net-api documentation is very bad, this is kind of a shot in the dark.

I've forked the repository on GitHub and I'm going to try to generate the XMLDoc comments for the library in the next few days. Hopefully it'll get released with the next version.

Brandon
  • 4,491
  • 6
  • 38
  • 59