We’re facing an issue related to workflow transitions in our Exalate-based synchronization between Jira PSP and Jira Partners.
Both instances use the same workflow, which includes two different transitions (e.g., A1 and A2) from status “A” to status “B”. Each transition has a distinct business purpose and its own set of post-functions.
The problem arises when transition A2 is triggered in Jira PSP. During synchronization, Exalate automatically executes transition A1 on the remote Jira (Partners), seemingly because it has the lower workflow ID. This results in incorrect behavior, as the remote issue does not follow the intended process.
We would like to have a way to explicitly define which transition should be used on the remote side — especially in cases where multiple transitions exist between the same pair of statuses.
Hi
Yes, this is achievable, but it comes with a few caveats.
The proper way to do it is on the incoming sync of the Partners Jira, you will need to add an if condition and then use the transition Helper(here is the doc) to user the transition that you want.
That being said, the helper usually relies on the status names. My understanding is that in your use case, the status will remain the same, but you need to trigger a different transition.
If that’s the case, this can be achieved if the transitions have a unique identifier (for example, a custom field on the remote issue that needs to be populated).
As an example, let’s say that transition A1 requires the custom field ‘cf’ to have the value “A1”, and transition A2 requires ‘cf’ to have the value “A2”. In that scenario, you could use something like this in your incoming sync rule
if (replica.status.name == "Status A" && replica.customFields."cf" == "A1" && issue.status.name == "Status A") {
workflowHelper.transitions(issue, "A1")
} else if (replica.status.name == "Status A" && replica.customFields."cf" == "A2" && issue.status.name == "Status A"){
workflowHelper.transitions(issue, "A2")
}
If you do not have an unique identifier like a CF, it will be difficult to specify to Exalate which transition should be using since both status can transition using A1 or A2.
Let me know if you have any further questions.
Best,
Kevin
@Martin_Bosano can you please check if this solution worked or not?