You should be doing it during the sprint as your developers complete the stories.
But if you need to do a tidying up exercise in bulk, yes, you can search for the issues and then use bulk-edit to transition them through the workflow into a status that is in the last column.
Because a sprint shows what is currently in it, irrespective of status. The whole point of the sprint is to contain a set of issues that you've committed to doing. And the board is there to show progression, including all the stuff you've marked done. It doesn't drop "done" issues, the whole point is that you can see that they're there.
When you close the sprint, items done in that sprint will be seen as closed issues - they won't appear in the backlog, or in the next sprint because, well, they're done and the new sprint should be committing to doing the next selection of issues that need doing. If an issue is not done when you finish a sprint, it will go into the next sprint, because it needs more work doing.
For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events