I'm trying to copy the value of the component/s system field to a text field. Below is the script used.
import com.atlassian.jira.bc.project.component.ProjectComponent
def formComponent=getFieldById("components")
def formUserField=getFieldByName("Activity")
List<ProjectComponent> components=formComponent.getValue() as List
formUserField.setFormValue("components")