Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get issue count without fetching issues in JRJC.

nlpraveennl
Contributor
June 28, 2018

I want to know how many issues (total) are the output of a query.

While using JRJC, to achieve pagination, first i want to know total issues that should be fetched out.

To know total. I was using like

Promise<SearchResult> searchJqlPromise = client.getSearchClient().searchJql("project=PROH");
int totalCount = searchJqlPromise.claim().getTotal();

But by default it tries to fetch 50 records first time. Even though i am not fetching issue for first time.(Just i need total count).

To make first call very lighter i used something like this.

searchJql(Query,MaxResults,startAt,Set<Fields>)

As given below

Promise<SearchResult> searchJqlPromise = client.getSearchClient().searchJql("project=TEST", 1, 0, null);
int totalCount = searchJqlPromise.claim().getTotal();

 

Is there any other ways? to achieve this. 

 

0 answers

Suggest an answer

Log in or Sign up to answer