public RedmineIssue GetIssueWithJournals(int id) { if (BaseUri == null) { throw new InvalidOperationException("BaseUri is not set"); } var xml = GetXml("issues/" + id + ".xml?include=journals"); var issue = RedmineXmlParser.ParseIssues(xml).FirstOrDefault(); if (issue != null) { issue.Url = GetIssueUrl(issue); } return(issue); }
public RedmineIssue[] GetIssues(string query = "assigned_to_id=me") { if (BaseUri == null) { throw new InvalidOperationException("BaseUri is not set"); } var xml = GetXml($"issues.xml?{query}"); var issues = RedmineXmlParser.ParseIssues(xml); foreach (var issue in issues) { issue.Url = GetIssueUrl(issue); } return(issues); }
public RedmineProject[] GetProjects() { if (BaseUri == null) { throw new InvalidOperationException("BaseUri is not set"); } var count = 1; var offset = 0; var projects = new RedmineProject[0].AsEnumerable(); while (offset < count) { var xml = GetXml("projects.xml", offset); var header = RedmineXmlParser.ParseHeader(xml); projects = projects.Concat(RedmineXmlParser.ParseProjects(xml)); offset = header.Limit + header.Offset; count = header.Count; } return(projects.ToArray()); }