KB : How does Synchronizer perform status transition


In TFS4JIRA Synchronizer, there are 2 ways to perform the status transition when the Synchonrizer detects that the associated TFS workitem is having a different state.



1 - Forcefully transition

TFS4JIRA Synchronizer will try to change the status of the Jira issue from the current status to the one mapped with the current state of the associated TFS workitem.

Example 1:

Status/State Mappings:

Jira StatusTFS State
To DoNew
In ProgressActive
ResolvedClosed


Issue/Workitem Data:


JiraTFS
Issue Key / Workitem IDDEMO-1#1
Current StatusTo DoNew
TFS Updated (Current Status)To Do (Not changed)Closed

What the user did:

    1. Change the state of workitem #1 from "New" to "Closed"

How Synchronizer works:

1. Sync cycle is triggered (initial sync / live sync cycle)
2. TFS4JIRA Synchronizer found out that there were updates from at the workitem
3. Current state of the workitem is not the same as the Jira issue status
4. Synchronizer tries to forcefully change the status of the Jira issue to the status which mapped with the current state of that TFS workitem (in the example, it tries to perform the status change from To Do → Resolved)
5a. If there's transition from To Do → Resolved , sync will be done
5b. If there's no transition from To Do → Resolved, it will try to perform the transition by following the workitem history


2 - Transition by following the workitem history

When (1) Forcefully transition doesn't work (transition is missing), the Synchronizer will try to perform the transition by following the workitem history (state changes)

Example 2:

Status/State Mappings:

Jira StatusTFS State
To DoNew
In ProgressActive
ResolvedClosed

Issue/Workitem Data:


JiraTFS
Issue Key / Workitem IDDEMO-1#1
Current StatusTo DoNew
TFS Updated (Current Status)To Do (Not changed)Closed

What the user did:

  1. Change the state of workitem #1 from "New" to "Active"
  2. Change the state of workitem #1 from "Active" to "Closed"

How Synchronizer works:

1. (1) Forcefully transition doesn't work because there is not transiton from To Do → Resolved (5b.)

The Synchronizer didn't pick up the change when the workitem state was at "Active" because the the state change happened before the Synchronizer catches the update.

2. Synchronizer tried to find the history in workitem #1 and find the path of the state changes

3. There's history, and the Synchronizer follows the history to perform the changes.

4. Synchronizer tries to perform the transition in DEMO-1 from "To Do" → "In Progress"

5. Synchronizer tries to perform the transition in DEMO-1 from "In Progress" → "Resolved"



if any states in between the beginning state and the current (end) state are not mapped, Synchronizer will not perform the transition by following the history.