I’m working with the JIRA REST API and need help filtering issues by sprint. I already know how to fetch all issues for the logged-in user:
rest/api/2/search?jql=assignee=currentuser()
Now I want to narrow this down to only show issues from the active sprint. I believe this requires the JIRA Agile plugin but I’m struggling to find proper documentation.
I noticed there’s some sprint data in the response that looks like this:
This data looks like serialized object information and I’m not sure how to work with it. What’s the proper way to query for issues that belong to the current active sprint? Any guidance would be appreciated.
there’s actually an easier way - just use sprint in openSprints() in your JQL query. so it becomes rest/api/2/search?jql=assignee=currentuser() AND sprint in openSprints(). no need to manually fetch sprint IDs - jira automatically handles the active sprint lookup.
The custom field approach works if you parse it right. That serialized sprint object has the sprint ID at the end - in your example it’s id=67. You can extract this programmatically for other queries. But there’s an easier JQL function nobody mentioned: sprint in activeSprints(). This gets all issues in any active sprint across your instance. Your query becomes rest/api/2/search?jql=assignee=currentuser() AND sprint in activeSprints(). The difference from openSprints() is that activeSprints() only returns currently running sprints, while openSprints() includes future sprints that haven’t started. This matters when your team pre-loads upcoming sprints with issues.
You’re right - you need the JIRA Software REST API for this. That serialized sprint data in customfield_10008 is a pain to work with in JQL. Here’s what works: First grab the active sprint ID from /rest/agile/1.0/board/{boardId}/sprint?state=active, then drop it into your JQL: rest/api/2/search?jql=assignee=currentuser() AND sprint={sprintId}. Even better - use the agile search endpoint directly: /rest/agile/1.0/sprint/{sprintId}/issue?jql=assignee=currentuser(). It does both steps at once. The tricky part is finding your board ID. Hit /rest/agile/1.0/board or filter by your project key if you know it. Pro tip: I cache the active sprint ID so I’m not hammering the API. Just remember to refresh it when sprints roll over.