Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Query issue is limited to 20 issues

Hi,

I am using

 // create a connection to JIRA
 var jira = new Jira("http://<your_jira_server>", "<user>", "<password>");

 // use LINQ syntax to retrieve issues
 var issues = from i in jira.Issues
              where i.Assignee == "admin" && i.Priority == "Major"
              orderby i.Created
              select i;
and query result only with first 20 items.
How can i get remaining issues?
 
Thanking you in advance.

6 answers

Try setting the MaxIssuesPerRequest property. For instance:

jira.MaxIssuesPerRequest = int.MaxValue;

you can achieve this using following code :

 int itemsPerPage=1;

int startAt=0;

IPagedQueryResult<Issue> pagedQueryResult = await _oJira.Issues.GetIssuesFromJqlAsync($"project = {projectName} ORDER BY created DESC", itemsPerPage, startAt);

if (pagedQueryResult.Count() > 0) {

_oJira.MaxIssuesPerRequest = pagedQueryResult.TotalItems;

var listTickets = (from i in _oJira.Issues.Queryable  where i.Project.Equals(projectName, StringComparison.InvariantCultureIgnoreCase) select i).ToList();

}

It returns max 1000 even if there are more number of Jira items.

Has anyone figured this out yet? I am having the same problem...

Has this been resolved?

Even when you use int.MaxValue or "-1", the max issues returned is 1000.
How do you get to access all the issues?

I get a limit of 100. :( I had to loop through fetching multiple results. Msg me if you want my sample code. 

yup, please Colin - can you post it up?

try "jira.Issues.MaxIssuesPerRequest = 2000"

I share my solution to the problem, which is getting the issues page by page and storing them in a List:

private static List<Issue> GetIssues(Jira jira, string jql)
{
List<Issue> issues = new List<Issue>();

int incr = 0;
int total = 0;

IssueSearchOptions s = new IssueSearchOptions(jql);

do
{
s.StartAt = incr;
s.MaxIssuesPerRequest = 100;

Task<IPagedQueryResult<Issue>> results = GetIssuesAsyncPaged(jira, s);
results.Wait();

total = results.Result.TotalItems;

foreach (Issue i in results.Result)
{
issues.Add(i);
}

incr += results.Result.Count();

} while (incr < total);

return issues;
}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

209 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you