Skip to content

Commit

Permalink
maxResults configurable fixes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
aripatrick committed Apr 21, 2016
1 parent cd693b1 commit ae34f27
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
38 changes: 16 additions & 22 deletions Jira.SDK/Domain/IssueFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,28 @@
using System.Text;
using System.Threading.Tasks;

namespace Jira.SDK.Domain
{
public class IssueFilter
{
private Jira _jira { get; set; }
public Jira GetJira()
{
return _jira;
}

public void SetJira(Jira jira)
{
_jira = jira;
}
namespace Jira.SDK.Domain {
public class IssueFilter {
private Jira _jira { get; set; }
public Jira GetJira() {
return _jira;
}

public void SetJira(Jira jira) {
_jira = jira;
}

public String Name { get; set; }
public String Description { get; set; }
public String JQL { get; set; }

private List<Issue> _issues;
public List<Issue> GetIssues()
{
if (_issues == null)
{
_issues = _jira.Client.SearchIssues(this.JQL);
_issues.ForEach(issue => issue.SetJira(this._jira));
}
return _issues;
public List<Issue> GetIssues(Int32 maxResults = 700) {
if (_issues == null) {
_issues = _jira.Client.SearchIssues(this.JQL, maxResults);
_issues.ForEach(issue => issue.SetJira(this._jira));
}
return _issues;
}
}
}
2 changes: 1 addition & 1 deletion Jira.SDK/IJiraClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface IJiraClient
List<Issue> GetIssuesFromSprint(Int32 sprintID);

Issue GetIssue(String key);
List<Issue> SearchIssues(String jql);
List<Issue> SearchIssues(String jql, Int32 maxResults);

Issue AddIssue(IssueFields fields);
Comment AddCommentToIssue(Issue issue, Comment comment);
Expand Down
4 changes: 2 additions & 2 deletions Jira.SDK/Jira.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ public Issue GetIssue(String key)
return issue;
}

public List<Issue> SearchIssues(String jql)
public List<Issue> SearchIssues(String jql, Int32 maxResults = 700)
{
List<Issue> issues = Client.SearchIssues(jql);
List<Issue> issues = Client.SearchIssues(jql, maxResults);
issues.ForEach(issue => issue.SetJira(this));
return issues;
}
Expand Down
4 changes: 2 additions & 2 deletions Jira.SDK/JiraClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public string GetBaseUrl()
return Client.BaseUrl.ToString();
}

public List<Issue> SearchIssues(String jql)
public List<Issue> SearchIssues(String jql, Int32 maxResults=700)
{
return GetIssues(_methods[JiraObjectEnum.Issues], new Dictionary<String, String>() { { "jql", jql }, { "maxResults", "700" }, { "fields", "*all" }, { "expand", "transitions" } });
return GetIssues(_methods[JiraObjectEnum.Issues], new Dictionary<String, String>() { { "jql", jql }, { "maxResults", maxResults.ToString() }, { "fields", "*all" }, { "expand", "transitions" } });
}

#region Groups
Expand Down

0 comments on commit ae34f27

Please sign in to comment.