Transition Issues
With HAPI, we've made it easy for you to transition issues and even update fields while you transition issues.
Transitioning issues
To transition an issue, run the following script from the script console:
In this example we're starting progress on an issue.
def issue = Issues.getByKey('ABC-1')
issue.transition('Start Progress')
Updating fields while transitioning issues
You can also update fields during a transition. For example:
In this example we're resolving an issue, setting the resolution, and adding a comment.
def issue = Issues.getByKey('ABC-1')
issue.transition('Resolve Issue') {
setResolution('Done')
setComment('resolving this issue')
}
See our Javadocs for a full list of fields.
Skipping conditions, validators, and permissions while transitioning issues
You can use transitionOptions to skip conditions, validators and permissions during a transition. For example:
groovydef issue = Issues.getByKey('ABC-1') issue.transition('To Do') { transitionOptions { skipConditions() skipPermissions() skipValidators() } }
Known limitation when transitioning from a post-function
Due to a limitation, we recommend against calling issue.transition() on the current issue inside a custom script post-function. When this is done, the transition is recorded in the issue’s activity history, but the issue’s current status may not update correctly.
Workaround
Use a Custom Listener instead, which runs outside the workflow transition steps and is not affected by this behaviour.

