Fast-track Transition an Issue
The Fast-track transition an issue post-function transitions an issue to a chosen status if the provided condition holds true. For example, we can use this post function to make sure any issues created with the priority status of Highest are immediately escalated.
This post function can be applied multiple times within a single transition, such as the Create Issue transition. By doing so, you can dynamically set different default start statuses for an issue based on specific conditions you define.
Post function actions and options
You can specify additional actions and options to optimize this post function—we provide information on these below.
Additional issue actions
When fast-track transitioning an issue you may want to perform additional actions, such as adding a comment to the issue, assigning a person, updating fields, or adding a resolution. This is all done through Additional issue actions code editor. For example, if you use this post function to resolve an issue you can use the following code to set the resolution and assign the issue to a user:
import com.atlassian.jira.component.ComponentAccessor
def constantsManager = ComponentAccessor.getConstantsManager()
def resolution = constantsManager.resolutions.findByName("Done")
issueInputParameters.setResolutionId(resolution.id)
issueInputParameters.setAssigneeId("admin")If you want to add a comment to the issue you can use the following:
issueInputParameters.setComment('your comment')Update Fields
We use IssueService to execute the fast-track transitions, which aims to mimic the behavior of the user interface. By default, you can only update fields that appear on the transition screen. If you need to update a field that isn't on the screen, or if there's no screen associated with the transition, you can use the following code:
issueInputParameters.skipScreenCheck()This allows you to update the issue even without a screen present.
Transition options
We provide advanced transition options that allow you to selectively bypass permissions, validators, and conditions during a transition. These features provide greater flexibility in workflow management:
- Skip Permissions: Force transitions to occur even when the user lacks the typically required permissions.
- Skip Validators: Proceed with transitions even when standard validation rules aren't met.
- Skip Conditions: Execute transitions regardless of predefined conditional checks. This function does not apply to the condition on the Fast-track transition an issue page. This function only applies to other conditions that are associated with the transition you select from the Action drop-down.
These options are particularly useful for automating processes that need to operate outside standard user permissions.
Use this post function
You can now test to see if this post function works.