How to query JIRA tickets closed within the past 7 days using SOAP API

I need help finding a better way to retrieve all JIRA tickets that got closed during the past week. Right now my approach is pretty clunky.

Currently I’m iterating through each ticket in the project and checking if the resolution date falls within the last 7 days. The problem is I have to specify start and end ticket numbers like MYPROJECT-500 through MYPROJECT-1500. This means I need to keep updating the upper limit manually as new tickets get created, which is annoying.

I thought about setting a really high upper bound like MYPROJECT-9999999 to avoid this issue, but then the script takes forever to run.

The tricky part is that older tickets with low ID numbers might have been resolved recently, so I can’t just look at newly created tickets since the last time I ran this.

Does anyone know a cleaner approach to handle this with the SOAP API? I’m looking for something more automated that doesn’t require hardcoded ranges.

totally agree, JQL is a lifesaver! that manual stuff takes forever. just be careful with results, some projects have a ton of tickets and you could run into timeout issues. might wanna toss in a maxResults param to keep it simple.

Had the same headache working on compliance reports a few months ago. The SOAP API docs don’t make it obvious, but you can combine multiple date operators in JQL for better filtering. Using resolved >= startOfDay(-7d) AND resolved <= endOfDay() worked way better than just -7d. Cleaner boundaries and no timezone issues with relative dates. If you’re dealing with large projects, add pagination with the startAt parameter in your SOAP calls. Learned this the hard way when a project had 800+ tickets resolved in one week and the query just hung. Breaking it into 100-200 result chunks keeps everything running smooth.

The SOAP API’s search method takes JQL queries - that’ll fix your problem. Skip the ticket range iteration and just use resolved >= -7d in your JQL string. The server filters by resolution date for you.

I hit this same issue years ago building automated reports. Use getIssuesFromJqlSearch with a proper JQL filter. Let JIRA do the work instead of downloading every ticket and filtering locally.

Try something like project = MYPROJECT AND resolved >= -7d AND resolution is not EMPTY. You only get matching tickets back, so no performance hit from checking thousands of irrelevant ones. Way cleaner than managing ID ranges, and it handles weird cases like old tickets getting resolved recently without extra work.