Reputation: 1893
<FIELD name="Assigned Date" refname="CustomFields.Groundup.Workitem.AssignedDate" type="DateTime" reportable="dimension" />
<FIELD name="Feedback Date" refname="CustomFields.Groundup.Workitem.FeedbackDate" type="DateTime" reportable="dimension" />
<STATE value="Assigned">
</STATE>
<STATE value="For Feedback">
</STATE>
<TRANSITION from="For Feedback" to="Assigned">
<REASONS>
<DEFAULTREASON value="Assigned" />
</REASONS>
<FIELDS>
<FIELD refname="CustomFields.Groundup.Workitem.AssignedDate">
<SERVERDEFAULT from="clock" />
</FIELD>
</FIELDS>
</TRANSITION>
<TRANSITION from="Assigned" to="For Feedback">
<REASONS>
<DEFAULTREASON value="For Feedback" />
</REASONS>
<FIELDS>
<FIELD refname="CustomFields.Groundup.Workitem.FeedbackDate">
<SERVERDEFAULT from="clock" />
</FIELD>
</FIELDS>
</TRANSITION>
Both dates (Assigned and Feedback date are updated for both transitions). Can someone push me to the right direction why it behaves this way and how to work around it.
Currently using TFS 2018 On Prem
Upvotes: 1
Views: 181
Reputation: 15998
That`s really interesting situation but we can not see the full content of your work item type definition. However, you can test the workaround:
The rule something like that:
<WHENNOT field="System.State" value="For Feedback">
<READONLY/> //or frozen
</WHENNOT>
Upvotes: 0
Reputation: 31003
I've tested in Tfs2018.Update3.2 with the definition below and it works as expected. When transit from Assigned
to For Feedback
, field Feedback Date
update to current time. When transit from For Feedback
to Assigned
, field Assigned Date
update to current time.
<FieldDefinition name="Assigned Date" refname="CustomFields.Groundup.Workitem.AssignedDate" type="DateTime" reportable="dimension" />
<FieldDefinition name="Feedback Date" refname="CustomFields.Groundup.Workitem.FeedbackDate" type="DateTime" reportable="dimension" />
<State value="Assigned" />
<State value="For Feedback" />
<Transition from="Assigned" to="For Feedback">
<REASONS>
<DEFAULTREASON value="For Feedback" />
</REASONS>
<FIELDS>
<FIELD refname="CustomFields.Groundup.Workitem.FeedbackDate">
<SERVERDEFAULT from="clock" />
</FIELD>
</FIELDS>
</Transition>
<Transition from="For Feedback" to="Assigned">
<REASONS>
<DEFAULTREASON value="Assigned" />
</REASONS>
<FIELDS>
<FIELD refname="CustomFields.Groundup.Workitem.AssignedDate">
<SERVERDEFAULT from="clock" />
</FIELD>
</FIELDS>
</Transition>
Upvotes: 0
Reputation: 15998
You use the same CustomFields.Groundup.Workitem.AssignedDate field in both transitions.
Upvotes: 1