How to recreate scripts for ScriptRunner (post functions used in Jira Workflows) in Cloud?

Sourav Mallick October 27, 2023

I am trying to recreate scripts for ScriptRunner (post functions used in Jira Workflows).

The script is throwing the error at "Import com.atlassian.jira.component.ComponentAccessor".

 

It is giving the error: "Invalid Imports".

 

I do have the following reference document here: https://community.atlassian.com/t5/Jira-questions/Getting-import-error-in-Script-runner/qaq-p/1218966

 

I would like to know the way out for the post-functions used in Jira workflows in Server to work in cloud. If recreating the scripts in cloud is not the option what is the workaround?

1 answer

1 vote
Oliver Siebenmarck _Polymetis Apps_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2023

Hi @Sourav Mallick ,

The TL;DR is: You'll have to put in some work to adapt or rewrite your scripts. Adaptavist have a nice guide here: https://www.scriptrunnerhq.com/inspiration/blog/rewriting-scriptrunner-scripts-for-migration

Although ScriptRunner Cloud still uses Groovy, the actual Jira APIs that can be used are quite different between Server/DC and Cloud. On Cloud, you can only use the REST and GraphQL APIs, while you had virtually all internal APIs at your disposal on Server/DC. Neither is better or worse, just different with different tradeoffs.

Hope that helps,
 Oliver

Suggest an answer

Log in or Sign up to answer