Get Option as String

I’d like to compare two values and only allow a transition to occur if they are equal, rendering the condition true.

The first value is the issue’s Issue Type. The second value is the Option value of a Single Select custom field.

Here’s what I’m working with:

def issueType = issue.getIssueType().name
def optionValue = issue.getCustomFieldValue(singleSelectCF) // need this as a String

assert (issueType == optionValue) : "error"

Is there a simple way to get the Option value as a String, so that I can compare the two?

You can do a getValue() on the Option. See