I have a select list custom field named "Change" with only 2 options (Yes, No). The default is set to No. On a transition I want to update the value of Change to Yes using a script post function.
Here's my attempt:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.option.Option
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def changeCf = customFieldManager.getCustomFieldObjectByName("Changes")
issue.setCustomFieldValue(changeCf, 10704)
10704 is the id of the option Yes. It shows error when I try to execute the transition. What do I need to change?