-3

I've got a C# program that uses the Jira API. I'm encountering a new problem where I'm trying to GET newly created Jira issues from the past month, but the JSON response from the API isn't giving me any of the paging info (startAt, maxResults, total, etc.). It is just starting with {"\issues":[....

I can't page through the data without this info, but it doesn't look like I can force the response I need (I even included startAt and maxResults to attempt it to "consider" those and possibly return them), and I think the URL is well-formed. Does anyone have any insight? It might be worth noting that the API we were originally using got deprecated, so I changed it to use version 3. Here is what the URL looks like:

"https://bec-sv.atlassian.net/rest/api/3/search/jql?jql=created%20%3E%3D%20-35d&fields=id,key,issuetype,created,customfield_12106,status,reporter,summary,updated,customfield_12111,customfield_11700,customfield_12107,assignee,customfield_12113,customfield_12108,customfield_12134,customfield_12226,customfield_12207,customfield_11902,fixVersions,customfield_10008,customfield_12283,customfield_12326,customfield_12325,customfield_12327,customfield_12321,customfield_12320,customfield_12329,customfield_12330,customfield_12331,customfield_12328,customfield_10007&startAt=0&maxResults=1000"

2 Answers 2

0

It is completely impossible to use the /rest/api/3/search endpoint they have cited and somehow "bring back the pagination info" as people claim.

The new JQL Search endpoints for both the v2 and v3 REST APIs of Jira Cloud do not use the startAt declarative parameter, and they do not return a total object in their responses; this is expected behaviour, as described in their documentation. However, you can still use the maxResults parameter to declare the number of objects returned per page, as described in their documentation.

Go to the Jira section of the Atlassian public Community Forum and do a general search on the topic of the new JQL Search endpoints. You'll find the topic has been discussed many, many, MANY times there over the past six months, and there are detailed descriptions and links to extensive documentation on how to use the new endpoints properly, especially the examples of their totally different pagination mechanism to their predecessors.

PS. I noticed you also declared maxResults=1000 in your GET request. That is pointless, as the JQL Search endpoints absolutely will not return more than 100 objects per page UNLESS you ask for only the fields id or key to be returned. That too is described in the documentation for those endpoints.

Sign up to request clarification or add additional context in comments.

Comments

0

I figured it out. The search API string for the next call simply needs to be appended with "&nextPageToken=" and then the token, and keeping all of the same search criteria and returned fields.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.