We are using TFS Integration to keep work items synchronized across 2 servers in real-time. The synchronized work items do not have the same Id, as expected. One server is our "Master".
Goal: The Master's Ids are visible on the Secondary system.
To try to solve this, we created a new field called MasterId as follows:
<FIELD name="MasterId" refname="..." type="Integer">
<COPY from="field" field="System.Id" /></FIELD>
The COPY attribute only exists on the Master's side, so that only the Master populates the field. In theory, the MasterId is then visible on the Secondary server's side. This works...sort of.
Problem Statement: The problem is that when the Work Item is first created and saved, it does *not* populate the field.
* In a Query result window, the MasterId column is blank. If you select a row, the Master Id is set dynamically. If you move on to another row, it blanks out again. (Very weird behavior.)
* If you open the Work Item a 2nd time and save it again, the field is then populated the way we wanted it populated the first time. Now it can sync across to our secondary server.
Please advise on how to solve the Problem Statement, or suggest an alternative means to accomplish the Goal. Thanks in advance!
When the work item is first created the “System.id” would not be assigned until the field is saved. Since the copy is done at the “field level” the System.ID is not set and hence it does not copy anything to the “MasterId” field.
You can try modifiying the work item to add the below to the "transition" tag
<TRANSITION from="" to="The first state of the work item"> <REASONS> ... </REASONS> <FIELDS> <FIELD refname="..."> <COPY from="field" field="System.Id" /> </FIELD> </FIELDS> </TRANSITION>
Hope this helps..