This is not something you want to automate, unless you mean just cloning entire sites (not a "migration", but taking a copy of a whole system and creating another one from it)
You always have to think about a migration - most of them are not simple migrations, they are merges, where you have to consider if the incoming data will be added to, update, or destroy existing data in the merge target.
On top of that, they're not simple processes. With Confluence, you can export and import whole spaces, but Jira does not have a (simple) project export/import process, you'll probably want to be using the Jira Cloud Migration Assistant to do your merging, which is not really something you can automate.