State Transition in jira.

I am looking for a groovy script or any other method through which i can move from one state to another within same workflow. for eg: there are 3 state now i want to jump on transition From State A to State C, so can you please help me out?