According to the REST API documentation, getting the change logs of an issue is done using the documented API call, which should return a paginated list of ChangeLogs.Here are some examples:https://jira.atlassian.com/rest/api/2/issue/JRA-22053/changelog
https://issues.apache.org/jira/rest/api/2/issue/CODEC-292/changelogThis call however always returns 404.I am aware that there is another way, which is getting the issue and expanding the changelog field, like this:
https://issues.apache.org/jira/rest/api/2/issue/CODEC-292?expand=changelog
https://jira.atlassian.com/rest/api/2/issue/JRA-22053?expand=changelog
However, it's not clear how one should paginate the expanded field, in the case where there are too many items in the changelog.Still, even if there is a way to paginate the expanded field using this second approach, the first approach (from the documentation) should work, but does not.
Hi @Aron Fiechter,
you were linking to the Cloud REST API docs which include the /changelog endpoint you mention. The latest Server REST API docs don't mention these - based on that and also on the two links you've provided, this endpoint is not available on Jira Server.
You still need to use the issue endpoint with expanding the changelog. This endpoint should contain all changes (based on my experience and according to the docs), so that there's no pagination needed.
Cheers,Matthias.
Hi @Aron Fiechter ,
I am able to fetch the changelogs with pagination using the below pattern on my Cloud Jira.
/rest/api/3/issue/${issueKey}/changelog?startAt=${startAt}&maxResults=${maxResults}
Can it be the case that you are not authenticated while calling the rest api? Because if I am not authenticated, I get 404 with below response body
{"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}
Hi @Mehmet A _Bloompeak_
I'm accessing the API from an external application, as I would access it using a simple curl call from my terminal.
I need to collect the changelog of issues for research purposes.
I'm specifically collecting issues and changelogs of openly accessible Jira instances of open source projects, such as the two I mentioned above.
The documentation says "This operation can be accessed anonymously", and in fact I'm able to access the changelog using expansion, and I'm able to get all issues using a Jql query, all without authentication, so authentication is not the issue.
Hi @Matthias Gaiser _K15t_
Thank you for your answer!I ended up using expansion like you suggested.
About the differences between Cloud and Server: In my application I'll likely have to deal with both situations, and I would be provided with a simple link to the issue tracker my app needs to access.
A solution could be to simply ask the user to select whether their tracker is Cloud or Server, but I was wondering if this could be determined automatically.
Best,Aron
You can indeed determine this automatically by calling the serverInfo endpoint which is available for Cloud and Server. It contains a property deploymentType which will give you the information you need.
You can compare these responses:
If the root url ends with .atlassian.net is to my experience also a good enough criterion to determine if it is a Cloud-based, instance.
Am I right?
It looks like you're new here. Sign in or register to get started.