Forums

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

all Issues fom a Project API

Negjat Jusaj October 6, 2022

Hello,

I want to export all tickets of a project to PowerBI via API call. This is currently limited to 100 tickets with the "maxresult" function.
Is there another way/ Api call to do this?

1 answer

1 vote
Fabio Racobaldo _Herzum_
Community Champion
October 6, 2022

Hi @Negjat Jusaj ,

maxResults is 100 in order to avoid that API could impact Atlassian cloud performances.

Based on the total and msxResults, use startAt parameter in order to perform more than one call and use pagination.

Hope this helps,

Fabio

Georgi Gachev _Nemetschek Bulgaria_
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.
October 6, 2022

Hi @Negjat Jusaj

As far as I know Fabio is correct, that's how I do it as well and I also wanted to find a way to get more than 100 issues in one call.

Just one addition from my side is that if you just query for the issue key, the API allows you to have maxResults set to a bigger number (10 000 maximum), for example /rest/api/2/search?maxResults=10000&fields=key

Greetings,
Georgi

Negjat Jusaj October 6, 2022

Hello everyone,

Thanks for the answer.
How do I get multiple maxresults/startat calls in one url?
Can you give me an example here?

This call doesn't work

https://sxxxxxx/rest/api/3/search?jql=project=ISD&startat%20=%200&maxResults=100&startat%20=%20101&maxResults=300

Georgi Gachev _Nemetschek Bulgaria_
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.
October 6, 2022

Hi @Negjat Jusaj

You can't have multiple calls in the same URL. You would have to use startAt=0 and maxResults=100 for example to start with and call:

/rest/api/3/search?startAt=0&maxResults=100&jql=project%20=%20ISD

Then when this request returns results you will see:

{"expand":"schema,names","startAt":0,"maxResults":100,"total":15539,"issues":[{"

 Then you have to check that your total is not reached yet so you just add maxResults to the current value of startAt and use that for the new startAt value, in our case the second call will be startAt=100 and maxResults=100

/rest/api/3/search?startAt=100&maxResults=100&jql=project%20=%20ISD

Then continue this process with startAt = 200, 300, etc. until you get all of the results.

Hope this helps,

Greetings,
Georgi

Negjat Jusaj October 6, 2022

Thanks Georgi,

 

it meanse i must do this by a json Script?

Georgi Gachev _Nemetschek Bulgaria_
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.
October 6, 2022

Hi Negjat,

Yes, some sort of script can work for you, as long as you process the json properly (script, java/js code, etc.) and call the next page with new startAt value you will be fine.

Regards,
Georgi

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events