cancel
Showing results for 
Search instead for 
Did you mean: 

How do I loop through pages with JIRA API, using the HTTP Client snap?

terrible_towel
New Contributor II

Hi,

I've been trying to configure the snap with no success.

terrible_towel_1-1702994765873.png

My goal is to do a get request, and loop through the pages, since Jira API only returns the first page.
So it would look something like this:
http://jira_get_request & offset = X 

The offset keyword is concatenated at the end of the request, where X is the page number.

Can anyone here help me configure this using the HTTP Client snap?

Thanks !

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

@terrible_towel - If you have specified any of the query parameters in your original URI, I suggest you move them to the Query Parameters settings.  This will make the pagination configuration simpler.

Has Next: $entity.issues.length == $entity.maxResults

In the Pagination section, set as below:

koryknick_0-1703069393721.png

Hope this helps!

View solution in original post

5 REPLIES 5

koryknick
Employee
Employee

@terrible_towel - sorry for the delayed reply.  Coding is both science and art, and much like sculpture and paintings, "better" is often a subjective term.  There is no real performance difference in your solution vs mine. 

Personally, I try to take a minimalistic approach, which in this case means overriding just the one query parameter that changes rather than reconstructing the entire URI in the Next URI property.