Forums

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

How to add pagination to Search Issues ( picker ) API?

Raghav Mishra March 11, 2021

We're using an API to search Issues on Jira, (Get issue picker suggestion).
The response is somewhat like this: 

Response: 

"sections":[
{
"label":"History Search",
"sub":"Showing 2 of 2 matching issues",
"id":"hs",
"issues":[
{issue_1 and details},
{issue_2 and details}
]
}
]

 

I want to implement Pagination for the issues i'm receiving. I tried adding startAt and maxResults value in query params, but the result does not change and gives me a non paged response. 

Is there anyway I can limit my values with pagination 
References: 

  1. API Used 
  2. Community solution for pagination

1 answer

1 accepted

2 votes
Answer accepted
Sunny Ape
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.
March 14, 2021 edited

Hello Raghav. Not all the REST API endpoints return the results in a paginated format, only those whose operation could potentially produce a very large number of results.

The /rest/api/3/issue/picker is one of the endpoints that does not return the results in paginated format, so defining the startAt and maxResults parameters has no effect. You will have to manage the results returned in your code.

Raghav Mishra March 14, 2021

Thanks @Sunny Ape 
will I be able to add pagination if I search Issues by JQL search? 

JQL Search API

Sunny Ape
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.
March 14, 2021

Yes.

In the REST API documentation for that endpoint, you will see that it specifically describes using startAt and maxResults to paginate the results:

 

startAt

integer

The index of the first item to return in a page of results (page offset).

Default: 0, Format: int32

 

maxResults

integer

The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a large number of fields are requested. The greatest number of items returned per page is achieved when requesting id or key only.

Default: 50, Format: int32

Like Raghav Mishra likes this
Raghav Mishra March 16, 2021

Thanks @Sunny Ape We've moved our APIs to JQL and are able to paginate data now. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events