Forums

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

Is there a lag between Issues reported in search UI and REST API

MQSquids April 14, 2025

Hi,

I'm trying to fetch the data from `/rest/api/2/search` based on $"jql=updated >= '{startTime}' AND updated < '{endTime}'". I have the scheduling setup to run every 5mins. Scheduled runs are not returning any data for the triggered datetime. However, if I run the jobs later, they are yielding records. 

This makes me feel there might be lag between the UI and REST API. Any idea of how much it is? or any pointers to this info would be appreciated. 

Further, what is the best frequency to fetch the issues well within the max results limit using updated filter?

Thanks,

Deepthi

1 answer

1 accepted

2 votes
Answer accepted
Marc - Devoteam
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.
April 15, 2025

Hi @MQSquids 

It shouldn't but what if you use the latest API?

/rest/api/3/search/jql?jql=updated >= '{startTime}' AND updated < '{endTime}'

And what is your reference to max results, this in the API is 5000 issues per page.

See https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-jql-get 

MQSquids April 15, 2025

Hi Marc, 

Thanks for looking into this!

This is great, looks like api/3 is bringing in data for real time. Based on my previous reference to JIRA API documentation (https://docs.atlassian.com/software/jira/docs/api/REST/9.17.0/#api/2/search-search), I had set 50 as max results. However, for 5 min range it hardly met that threshold so far. 

Glad to see api/3 version can handle up-to 5000 issues per page to retrieve only Ids/Keys. For my scenario, I need to fetch bit detailed issues information expanding ChangeLog, Fields and History. 

Is there a way to know - number of issues updated by time series under JIRA UI?

If so that might help to set a reasonable limit on max results. 

Thanks 

 

Like Marc - Devoteam likes this
MQSquids April 15, 2025

Is there any example to refer how the paging works if the total exceeds max results. I tried using nextPageToken to retrieve the details and response is not returning this parameter though total rows are exceeding max limit per page. Appreciate any guidance on this.

Marc - Devoteam
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.
April 16, 2025

Hi @MQSquids 

I'm having trouble on finding information on this as well.

It might be worth to create an issue at Atlassian Support for this

Like MQSquids likes this
Marc - Devoteam
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.
April 16, 2025

Hi @MQSquids 

I found some info.

"What is nextPageToken?

The nextPageToken is a continuation token used in Jira API since we use cursor-based pagination. It allows users to fetch the next set of results when the current page is full or when there are more results to retrieve. This approach replaces traditional offset-based pagination for better scalability and performance.

Initial Request:

When making the first API call, you do not need to include the nextPageToken parameter. The API will return the first page of results along with a nextPageToken in the response if there are additional pages.
Example Response:

{
"values": [
{ "id": "10001" },
{ "id": "10002" }
],
"nextPageToken": "eyJvIjoxfQ=="
}

Subsequent Requests:

You will now use the nextPageToken value from the previous response in your next API call to fetch the next page of results.
Example Call:

https://abcfoo.atlassian.net/rest/api/latest/search/jql?jql=issuekey%20IN%20updatedBy&#40;%22&#42;%22,%222024-10-30%22,%222024-11-11%22&#41;&fields=\{fields}&nextPageToken=%3Cstring%3E
End of Results:

When there are no more results, the nextPageToken will either be null or absent in the response, indicating that you've reached the end.

Here are common issues that you should know about the nextPageToken token.

Invalid or Expired Token: If you receive the error "the provided next page token is invalid or expired," ensure that you are using the exact nextPageToken value from the previous response.

Empty Token: If you leave the nextPageToken parameter empty, the API will not know where to continue fetching results, leading to an error.

I hope this explanation clarifies how to use the nextPageToken in your API calls.

Like MQSquids likes this
MQSquids April 17, 2025

Thanks Marc for the details. 

Like Marc - Devoteam likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events