What is the alternative to migrate Scriptrunner behavior to Cloud
Asked by Manoj Gangwar:

Hello Team,

We are planning to migrate Jira from DC to Cloud version and having some questions regarding Scriptrunner data migration. Below things will not work in cloud so what is the alternative and how it will work in Cloud same like DC. Is there any other plugin we can use to achieve the same.

1- Behaviours don't work on Issue view of JSM Project in cloud.

2- Behaviour is Used on a Transition Screen, Behaviours in cloud are either used on a create or View screen, and don't work on transitions.

3- Linked Issue and time estimate fields not supported


Answers:
author: Ram Kumar Aravindakshan _Adaptavist_
body: Hi [@Manoj Gangwar](/t5/user/viewprofilepage/user-id/4484987)

ScriptRunner for Jira Cloud currently has the [Behaviour feature](https://docs.adaptavist.com/sr4jc/latest/features/behaviours). However, it is limited and does not support all the capabilities that are doable on the ScriptRunner for Jira DC.

For Behaviour capabilities that are doable in both DC and Cloud, it would be best to use Behaviour itself.

Whereas for Behaviour capabilities that are currently not doable in the Cloud, it would be best to use the Listener.

Thank you and Kind regards,  
Ram

comments: author: Manoj Gangwar
body: Thanks for your reply [@Ram Kumar Aravindakshan _Adaptavist_](/t5/user/viewprofilepage/user-id/2988015)

I will try to replace Behaviour with Listener and test it.


author: Manoj Gangwar
body: The existing Behaviour is applied on the Issue Sub-Task workflow, If it is Transition to Resolved Status And Summary contains \~ xyz then customfield-xxxx should be visible on the Issue transition screen.  

I don't see any options in Listener to select particular workflow and Show/Hide fields. Could you please guide us to achieve the same.

```
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours

def summ = getFieldById('summary').value as String
def rag = getFieldByName('Request Assignment Group').value as String

def renewalDate = getFieldById('customfield_29018') //Renewal Date
def accessRequest = getFieldById('customfield_36510') //Access Request Spreadsheet
def form = getFieldById('customfield_25507') //Form
def signature = getFieldById('customfield_36511') //Signature
def backgroundCheck = getFieldById('customfield_36512') //Background Check

accessRequest.setHidden(true)
form.setHidden(true)
signature.setHidden(true)
backgroundCheck.setHidden(true)
renewalDate.setHidden(true)

if (summ.contains('Professional Service')){
contractNumber.setHidden(false)
contractNumber.setRequired(false)
prNumber.setHidden(false)
prNumber.setRequired(false)
poNumber.setHidden(false)
poNumber.setRequired(false)
renewalDate.setHidden(false)
renewalDate.setRequired(false)
}
else if (summ.contains('Client Access')){
accessRequest.setHidden(false)
accessRequest.setRequired(false)
form.setHidden(false)
form.setRequired(false)
signature.setHidden(false)
signature.setRequired(false)
backgroundCheck.setHidden(false)
backgroundCheck.setRequired(false)
}

??
```

Summary \& Request assignment is set to Hidden.


Tags: cloud-migration

jira-service-management

jira-service-management-server

migration

migration-customer-care

scriptrunner

server