To no surprise, all of our scripted field scripts are broken in our test migration to the cloud.
I tried to use chatgpt etc to guide me into code fixes (I am not a developer) and can't seem to get anything to work.
Original code working in server:
//
// Returns the value of the "FIELD" field from a
// subtask's parent issue.
//
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.component.ComponentAccessor;
if (issue.isSubTask())
{
def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("FIELD");
if (field != null)
{
return issue.getParentObject().getCustomFieldValue(field);
}
}
return null;
thanks in advance for any help!