Jira Align REST API Pagination Attribute Format

Kyle Salvador July 8, 2020

Using the Jira REST API's I can easily paginate the results, as it provides me a count of results returned, max results existing, and max results that can be returned at one time.

 

Example code for Jira:

/rest/api/2/search?jql=project=MYPROJECT&fields=key,summary&maxResults=200&startAt=201

 

We are looking to use the attributes:

maxResults=200

startAt=201

It seems that we have a limit of 100 results from any of the Jira Align REST APIs.

We have searched the swagger Jira Align pages, and were unable to see any formatting for this type of pagination of results.  Expect the Portfolio Epics to grow well beyond 10,000 records, as we enter more data into the system. So, we need a way to only pull a limited set. This also applies to the User list. 

5 answers

2 accepted

1 vote
Answer accepted
Kyle Salvador July 8, 2020

So, me developer had to code the pulls, so that they pulled increments of 100, and when the final array returned an empty array, that is when he stopped.

 

Still it might be nice, if the REST APIs were to provide a total count, a count returned.

1 vote
Answer accepted
Kyle Salvador July 8, 2020

I have found this page:

https://agilecrafthelp.zendesk.com/hc/en-us/articles/360048085774-10X-API-2-0-GET-Usage-and-Filters

and it provides some information on Basic Pagination.

Top: Return the first 10 Epics

syntax

/Epics?$top=<value>

Skip: Skip the first 521 epics and return all after

syntax

/Epics?$skip=<value>

If my REST CALLs are limited to 100, and I am not given a total count, how would I know when to stop trying to pull, unless I am comparing all the data I pull?

0 votes
David Yohler October 20, 2023

To reiterate, the Jira API has:
maxResults and startAt, plus returns the count and/or flag of last

The rough equivalent for Jira Align API is:
top (for maxResults / page size, default 100) and skip (for startAt)

Additionally, no indication that you came to the end is sent, if the result set happens to be the same as the top (aka maxResults) size, the subsequent fetch will return an empty response.  Otherwise, when the response set is less than the top (aka maxResults) size, that is all

0 votes
Serajul Arfeen June 11, 2022

@Kyle Salvador @Christoph Piotrowski [catworkx] Any working solution or example you have found so far on this issue?

0 votes
Christoph Piotrowski [catworkx]
Atlassian Partner
May 15, 2022

Hello @Kyle Salvador just wanted to check, if you found a way to just get the total number (your last question) as I have currently the same question.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events