I want to populate a Scripted Field with the count of a Free Text Field.
What should the last line of this script be?
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.customfields.manager.OptionsManager;
def componentManager = ComponentManager.instance;
def customFieldManager = componentManager.getCustomFieldManager();
def RelatedCasesField = customFieldManager.getCustomFieldObjectByName("Related Cases");
// return (RelatedCasesField.count());