JQL query to locate tickets recently moved into current sprint in Jira

My team works with a physical kanban board using printed cards for our tasks. I need help writing a JQL filter that can identify which tickets have been moved into our current active sprint within specific timeframes like the past day or couple of days. This would save me from having to manually check for new additions each time I print cards.

I attempted building a query but got stuck:

project = "My Project"
AND sprint = 1003  
AND (created >= -2d OR (updated >= -2d AND status WAS TODO BEFORE -2d))

This approach has problems though. First, I have to hardcode the sprint number instead of dynamically getting the active one. Second, the logic doesn’t really capture what I’m looking for. Any suggestions on how to properly filter for recently added sprint items?

instead of locking in the sprint number, you sould use sprint in openSprints(). for the tickets just added, try sprint in openSprints() AND sprint was not in (openSprints()) before -1d. just a thought, might need to tweak it a bit.

You’re on the right track but there’s a simpler approach that works well for this scenario. I’ve been using project = "Your Project" AND sprint in openSprints() AND updatedDate >= -1d AND sprint changed for similar situations. The key difference is using sprint changed without specifying a timeframe alongside the updatedDate filter. This combination catches tickets where the sprint field was modified recently, which happens when items get moved into your active sprint. I found this more reliable than trying to track status transitions since those can be misleading if tickets were already in progress before being added to the sprint. The openSprints() function eliminates the hardcoding issue you mentioned and automatically targets your current active sprint.

I had a similar challenge when managing our sprint board updates. The key insight is tracking when tickets actually got assigned to the sprint rather than when they were created or generally updated. Try using sprint in openSprints() AND sprint changed AFTER -2d. This captures tickets that had their sprint field modified in the last two days, which should catch new additions to your active sprint. You might also want to combine it with project = "My Project" AND sprint in openSprints() AND (sprint changed AFTER -2d OR (created >= -2d AND sprint in openSprints())) to catch both newly created tickets directly added to the sprint and existing tickets moved into it. The sprint changed clause is really the missing piece here since it tracks sprint assignment changes specifically.