You might be misleaded that it is possible through JIRA UI.
Through UI issue can be updated only with 1 active Sprint although it gives history for all Closed Sprints where issue was part. The concept is that Issue can live in one Sprint at the time from velocity accuracy perspective.
JIRA UI looks like it stores more then one values:
but actually when you go to edit , you can modify just one of it:
It actually shows History of the sprints where the issue was part and at some reason not closed or reopened.
The rest API will limit you if you try to update the issue with Agile API and when you update it , then it will truly update it as you stated.
{
"errorMessages": [
"You must specify a sprint which has not been completed."
],
"errors": {}
}
If you try to update active sprint of issue that was already part of currently Closed sprint. You will see that history won't be reset and your update will be added to the history Sprint.
As crazy workaround with REST API you may create sprints, assign issues to them and close the sprint and then again :)