Forums

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

How to get all issues related to particular project?

Nageswara Rao Koppisetti
Contributor
June 21, 2018

Hi All,

I have client requirement to get  all the issues related to particular project using this rest API.

https://itc-cloudio.atlassian.net/rest/api/2/search?jql=project="RUT"

API is working as expected but it is showing like this.

But Response showing 

"expand": "schema,names",
"startAt": 0,
"maxResults": 50,
"total": 160,

How to get total total number of issues.help.

I have to consume this api in java.

Regards,

Nageswara

 

 

 

1 answer

1 accepted

0 votes
Answer accepted
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.
June 21, 2018

Hello,

I guess the total:160 meanst that you have 160 issues, which satisfy your JQL search

Nageswara Rao Koppisetti
Contributor
June 21, 2018

I need total number :160.In my response i am unable verify all 160 issues.Is this api gives 160 issues .please clarify.that should be great.

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.
June 21, 2018

Do you mean that there are only 50 issues returned? If so, you can increase the number of the returned issues: maxResults = 100. But it is still less then 160. You need to call the REST API in iterations using the startAt parameter. You can find more info about parameters here:

https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-search-get

Nageswara Rao Koppisetti
Contributor
June 21, 2018

Hi Alexey

How to provide this maxResults, and startAt parameter the above rest API?.

Please provide me one example

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.
June 21, 2018
Nageswara Rao Koppisetti
Contributor
June 21, 2018

Hi Alexey,

I have tried this same API:/rest/api/2/search?jql=project="RUT" & maxResults=160.

But getting response like this.

"expand": "schema,names",
"startAt": 0,
"maxResults": 50,
"total": 160,
"issues": [

Is this response contains 160 records?

Please clarify.if this response contains 160 records.I am ok .

Regards,

Nageswara K

Warren
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.
June 21, 2018

The API can only return 100 results at a time, so your initial call of 

https://itc-cloudio.atlassian.net/rest/api/2/search?jql=project="RUT"

will return the first 100 items. In your code, you need to check that the total value is greater than 100, then do another call, as @Alexey Matveev said, with 

https://itc-cloudio.atlassian.net/rest/api/2/search?jql=project="RUT"&maxResults=100&startAt=101

which will return items 101 to 160 (up to 200).

If you have more than 200 items, you will need to do a third call with startAt set to 201 to get them.

Nageswara Rao Koppisetti
Contributor
June 21, 2018

Hi Warren and Alexy.

Is there any Rest API to pull  all issues based on the project.Please provide me .

I am new to this system.

Warren
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.
June 21, 2018

I think we've answered your question!

What you were doing, with the changes suggested by Alexey and myself, will give you all the issues for a project.

You may be asking a different question, but the way I'm reading it, we've answered it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events