Any migration from Server to Cloud will require rewriting scripts.
When migrating a script from Server to Cloud, you should follow these three steps:
- Analyse the purpose/functionality of the existing script.
- Find the equivalent feature in Cloud (use identical names where possible) and analyse the API.
- Rewrite and re-implement the new relevant scripts using ScriptRunner for Jira Cloud.
Interactions with the API needs to be replaced with calls to the appropriate REST APIs and it is possible that alternatives may need to be found for dependencies that are not available for ScriptRunner Cloud.
Note that at the time of writing only Script Listeners and Workflow Functions are implemented for ScriptRunner for Jira Cloud but Scripted fields that make calculations purely based on the state of the issue can be implemented as Script Listeners. The Script Registry Built-in script can be used to find all ScriptRunner scripts. Each script should be analyzed to determine if the functionality is desired and possible within the Cloud feature set. Once the scripts to be migrated have been identified, writing out the script in pseudo code making the intention clear is a good next step.
Each interaction with Jira should be compared against the REST API docs and the ScriptRunner for Jira features, however, some features have not yet been implemented in the Cloud.