Hey everyone, I’m having trouble with the Jira Server API. I’m trying to get the history of a specific issue to figure out how long it spent in each status. This is for calculating SLA adherence.
I’m using this endpoint:
/rest/agile/1.0/issue/PROJECT-123?expand=changelog
But it’s not giving me the changelog info I need. Instead, it’s returning all the worklogs, which I didn’t even ask for! That should be a separate call, right?
Has anyone else run into this? Any suggestions on how to get the actual changelog data? I’m scratching my head here. Thanks in advance for any help!
I encountered a similar issue recently. The Agile API can be finicky with changelog data. Have you considered using JQL queries instead? For example, try using GET /rest/api/2/search?jql=key=PROJECT-123&expand=changelog. This approach allows you to have more granular control over the returned fields. You might need to parse the response to extract the status transitions, but it’s generally a more reliable method for retrieving historical information. Also, verify that your account has the necessary permissions. Finally, check the Jira Server version, as older versions can have limitations with changelog retrieval.
As someone who’s worked extensively with Jira’s API, I can relate to your frustration, Alex. One thing that’s helped me in similar situations is using the /rest/api/2/issue/{issueIdOrKey}/changelog endpoint directly. This bypasses some of the quirks in the Agile API.
You might need to make multiple requests if there’s a lot of history, as it’s paginated. Something like:
/rest/api/2/issue/PROJECT-123/changelog?startAt=0&maxResults=100
Then parse the response to extract the status changes. It’s a bit more work, but I’ve found it more reliable for getting detailed changelog info.
Also, double-check your application link settings if you’re using an external tool. Sometimes permissions can get wonky there and cause unexpected behavior with certain endpoints.
heyy Alex, i’ve had similar issues. have u tried the classic API endpoint? it’s /rest/api/2/issue/PROJECT-123?expand=changelog
. that one usually gives me the full history. if that doesn’t work, maybe check ur permissions? sometimes that can mess things up. good luck!