How to determine which issues were 'Done' in a sprint?

Hi,

I’m trying to retrieve all issues that were finished in a sprint and get the sprint’s velocity.

The problem is that if the issue was started in a sprint and finished in a later sprint, the issue is still retrieved in the response of /rest/agile/1.0/sprint/[SPRINT_ID]/issue’. The issue’s resolution is “Done” although it was completed in the later sprint.

How can I determine which issues were finished in the given sprint?

Is there any other Jira API that would return this data?

Any help would be appreciated.