Help with Pagination for Jira On-Prem Changelog API

Sanjay Shukla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2025

Hi,

I need to fetch the changelog for a specific issue from a Jira On-Prem server. Currently, I’m using the following endpoints:

  1. rest/api/latest/issue/ABC-123/?expand=changelog
  2. rest/api/latest/issue/ABC-123/changelog

However, I’m facing two issues:

  1. The first endpoint returns the full changelog. I know the issue ABC-123 has 113 logs, but if the number increases significantly, the API might not return all data. I wanted to apply pagination on expand=changelog, but it doesn’t seem to work. Can anyone guide me on how to paginate this API?
  2. The second endpoint returns a 404 error. I suspect this is due to an older Jira version running on the server, but I don’t have access of server to check the exact version.

Any help would be appreciated!

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
David Bakkers
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 3, 2025

You can lookup the Jira version with the serverinfo endpoint, then you'll know what version of the REST API documentation you should be reading to learn if the changelog response object for the Get Issue endpoint is subject to pagination.

Also, if you Google 'Jira data center rest api issue changelog' the very first result is the thread that contains the answer as to why you are getting a 404 error when trying to access this endpoint on Jira Data Center:

rest/api/latest/issue/ABC-123/changelog

Have fun on your learning journey!

Sanjay Shukla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2025

Thanks, @David Bakkers! I understand why I'm getting the 404 error when accessing rest/api/latest/issue/ABC-123/changelog. But is there a way to apply pagination in rest/api/latest/issue/ABC-123/?expand=changelog ?

David Bakkers
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 3, 2025

But is there a way to apply pagination in rest/api/latest/issue/ABC-123/?expand=changelog ?

When you read the documentation for that endpoint, does it say it supports pagination?

Sanjay Shukla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 4, 2025

@David Bakkers , Thanks for your response. The documentation doesn’t mention if pagination is supported for this endpoint, which is why I asked. Based on the response format, I see the startAt and maxResults keys under the changelog metadata, so I thought pagination might be possible.

After calling the server info endpoint, I got the version number "9.12.15". Is there a way to retrieve all changelogs in Jira Data Center using any REST API? If an issue has more than 2,000 change logs, how can I fetch the complete data?

David Bakkers
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 4, 2025

If an issue has more than 2,000 change logs, how can I fetch the complete data?

What happened when you used that endpoint on an Issue with more than 2,000 change logs? Did the endpoint return the complete set of change logs in a single response? If not, what were the values of the startAt, total, and maxResults keys in the response?

When you declared a value for the maxResults parameter in your request, did the number of results returned per page change to that value?

When you declared a value for the startAt parameter in your request, did the results returned 'jump' to that position in the total set?

Sanjay Shukla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 4, 2025

@David Bakkers,  The response was delayed because I encountered this error while posting the message:
"You may have recently posted the same thing elsewhere in the community. Update your text or wait before reposting."

Here are the answers to your questions. Currently, there are 1,034 logs in the ABC-123 issue.

When I call this API:
http://10.12.11:8080/rest/api/latest/issue/ABC-123/?expand=changelog&maxResults=10&startAt=0&fields=key

I receive all 1,034 logs in the response:

{
    "expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
    "id": "10000",
    "self": "http://10.12.11:8080/rest/api/latest/issue/10000",
    "key": "ABC-123",
    "changelog": {
        "startAt": 0,
        "maxResults": 1034,
        "total": 1034,
        "histories": [ .... ]
    }
}

Even when I change startAt, I still receive all 1,034 logs. I want to understand the maximum limit or why pagination isn't working.

David Bakkers
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 5, 2025

I want to understand the maximum limit or why pagination isn't working.

I can see where you've asked this exact same question across multiple other threads on the same topic, where the answer to your question is already provided, but you seem to not be seeing the proverbial forest for the trees.

I was hoping that if I kept giving you enough hints, you'd work it out for yourself, but that doesn't seem to be happening.... so.....

It's not working because that endpoint doesn't support pagination.

  1. If you are setting the maxResults parameter to 10, 50, 1,000 or whatever in your request, but getting the same maxResults: 1,034 in the response, then the parameter is being ignored because that endpoint doesn't support pagination.
  2. If you are setting the startAt parameter to 0, 10, 50, 1,000 or whatever in your request, but still getting the same total in the response, then the parameter is being ignored because that endpoint doesn't support pagination.

So, you've proven it to yourself with these tests....

THAT ENDPOINT DOESN'T SUPPORT PAGINATION

...which of course means the endpoint will return ALL the change logs for an Issue in the same response UNLESS your Jira Admin has set a maximum response limit for the REST API, and only your Jira Admin can answer that question for you.

This is how Jira Data Center works compared to Jira Cloud. Most of the API endpoints are UNLIMITED because making requests for gigantic amounts of data only degrades the performance of your company's Jira instance, nobody else's.

Let's consider this topic closed now, OK.

Sanjay Shukla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 5, 2025

Thanks, @David Bakkers , for replying. I got the answer, so I'm closing this thread.

Suggest an answer

Log in or Sign up to answer