FYI I have created a similar post for Jira Cloud: Jira API search with reconcile all issues in a project