So I have this code in a Scripted Field:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.okapya.jira.customfields.ChecklistItem
@WithPlugin("com.okapya.jira.checklist")
def isReady(checklist) {
def uncheckedExists = false
def uncheckedRequiredExists = false
for (checklistCondition in checklist) {
def checklistItem = ((ChecklistItem) checklistCondition)
if (!checklistItem.isChecked()) {
uncheckedExists = true
if (checklistItem.isMandatory()) {
uncheckedRequiredExists = true
break
}
}
}
if (uncheckedRequiredExists) {
return "Not-Ready"
} else if (uncheckedExists) {
return "Required-Ready"
} else {
return "Fully-Ready"
}
}
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def fieldDoR = customFieldManager.getCustomFieldObject("customfield_14004")
def checklistDoR = fieldDoR.getValue(issue)
return isReady(checklistDoR)
Sometimes it works and sometimes it doesn't.
JIRA (Data Center - 2 nodes) version: v7.3.3#73014
ScriptRunner version: 5.2.2
Please help :)
Jira Cloud and Server are two very different applications, and hence, so is Scriptrunner on the two platforms.
You can't "convert" a script, or even most of the settings from one to the other, you will have to re-implement what you are doing in the way the new platform needs to do it.
Start with a read through https://docs.adaptavist.com/sr4js/latest/scriptrunner-migration/migrating-to-or-from-cloud/migrate-from-scriptrunner-for-jira-server-to-cloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.