Getting the current and destination steps depends on whether your function is placed above or below the functions to update the issue in the database and reindex.
The following code:
myIssue.statusObject.name
will return thecurrentstatus - so if your script function is before the built-in functions to update the issue it will return the "previous" status, if it is after it will return the destination status.
To get the destination step use:
import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.spi.Step
def step = transientVars["createdStep"]as Step
def stepId = step.getStepId()def status = ComponentAccessor.getConstantsManager().getStatusObject(stepId as String)
log.debug(status.name)