Forums

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

How to get the JIRA API result count with out getting the data.

Ravi Chand August 9, 2018

Hi,

I would like to get the only total result count of JIRA api request without getting the result data . So that i can raise a popup do you want display all result or limited result.

Below is such request i want to get only count.

https://www.example.com/rest/api/2/search?jql=issuetype="RICEFW"&fields=worklog

 

Thanks

Ravichand.

1 answer

1 vote
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2018

Hello,

You can set the maxResults parameter to 1 and have a look at the total value in the response:

{ "expand": "names,schema", "startAt": 0, "maxResults": 50, "total": 1, "issues": [ { "expand": "", "id": "10001", "self": "http://www.example.com/jira/rest/api/2/issue/10001", "key": "HSP-1" } ] }

Ravi Chand August 11, 2018

First we send with max Result and raise a popup and send the same request again if we do this twice

will there is a performance issue?

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 11, 2018

It all depends on how often you do it.

philubert
Contributor
January 31, 2022

You can also set maxResults to 0.

In that case, your results will look simply like this:

{"startAt":0,"maxResults":0,"total":1234,"issues":[]}
Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events