If you would provide classes where you implemnt the Jira Java API interfaces of all classes whose functionality is also available in the official Jira Cloud Rest API.
The classes would act just like they do on Jira server, but in the background they would perform the operations via REST.
This way a large percentage of most scripts i write could be migrated using copy & paste.