The 'Follow Up Transition' Post Function will evaluate the Workflow Conditions of all the next transitions on the target status of the current transition. If exactly one condition is valid, that transition will be triggered as a 'follow up'.
Consider the following workflow:
- Our issue has a mandatory number custom field.
- At the end of the 'Go' transition we have configured to 'Follow Up Transition' Post Function.
- Each transition leading away from the status 'Junction' have workflow condition:
- 'Under Five' has the condition: Number field < 5 ?
- 'Exactly Five' has the condition: Number field == 5?
- 'Over Five' has the condition: Number field > 5?
- When the user performs the 'Go' transition, this will always trigger a follow up transition.
For example if the user enters Number=3 during the 'Go' transition, he will end up at the status 'In Progress'. If he enters 42, this will lead him to 'Closed'.
In this example, we have been careful to configure our workflow conditions so that always only and exactly 1 condition can be true. Like this the user will never get 'stuck' at the 'Junction' state. Instead the 'Follow Up Transition' will lead him to the correct end state.
Tip: Since any workflow condition can be used for the follow ups, this provides you great flexibility. The JSU app has some quite useful additional Follow Up Transition . But you might also use some of another third party app.
However to complete your setup, you have to configure at least one workflow conditions. Let's continue the example from above, where a number field is evaluated. We will configure even 3 conditions - one for each outgoing transition from the 'Junction' status.
There is a fundamental difference between Jira Server/Data Center and Jira Cloud: In Jira Cloud post functions of apps are executed asynchronous as a 'background job'.
- This means a post function will be executed after the transition has completed on Jira Cloud.
- There is no guaranteed order in which several post functions are performed. They might be executed in a different order from the one you had set them up in Jira's workflow configuration. So you cannot rely on any result of a 'previous' post function. The order by which the post functions are executed might be different every time the transition is performed.
- When a post function has a problem (due to misconfiguration or the current data of a Jira issue), the transition (and all other post functions) will be performed nevertheless.
- The result of a post function might not be visible immediately in the browser.
- There are no error messages displayed to the user.
Here are some more ideas, how you might use the 'Follow Up Transition' Post Function.
Yes / No
A simpler more common case is, that you have only 2 transitions leading away and you evaluate basically the same condition, but at one condition negated.
- a == b?
Again you can use the Value Field Condition Conditions for this setup.
- Check it: 'Follow Up Transition' Post Function
- Yes: Condition a == b?
- No: Condition a != b?
Some extra step in your workflow might be only necessary if some condition is not fulfilled. Otherwise that step could be skipped.
See the Use Case Management Approval for another real life example.
My workflow gets stuck in the Junction status
Not exactly one condition
Usually the problem can be tracked down, by manually walking through what the follow up post function would do:
- If exactly one condition is valid
- that transition will be triggered
It's important that you do your analysis with the same user, that got stuck in the Junction status. There might be issues with permissions, that could lead to a different result, depending on the user performing the transition.
If you now look at such an issue, which got stuck in the Junction status: How many transition buttons does it have? Only if there is exactly one transition button, 'Follow up' will be triggered. If you have none or more than one transition button, you have to review your workflow conditions on the transitions leading out from the Junction status.
If there is only 1 button, there might be something wrong with that following transition. For example a validator could prevent the transition to get completed. Try (with the same user, who got stuck in Junction) to click that button to see what happens.
Triggered transition fails
Another reason might be that the transition which is triggered does not run through. For example if it has a validator configured, which fails.