Transition Issues
Migrating to Jira Cloud? This feature is available in Cloud. |
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:
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:
def issue = Issues.getByKey('ABC-1')
issue.transition('Resolve Issue') {
setResolution('Done')
setComment('resolving this issue')
} Skipping conditions, validators, and permissions while transitioning issues
You can use transitionOptions to skip conditions, validators and permissions during a transition. For example:
def 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.