TFS 2010 clear SystemAssignedTo in transition - tfs

We have introduced a "Code review" state for tasks, between "In progress" and "Done". When moving from "In progress" to "Code review" we would like to clear/unassign System.AssignedTo but I can't figure out how. Does anyone know where to put the logic in the WIT xml and what it should look like?
Thanks,
Mansos

Open your schema in an XML editor. Go down to the <TRANSITIONS> part and add
<TRANSITION from="In Progress" to="Code Review">
<FIELDS>
<FIELD name="Assigned To">
<EMPTY />
</FIELD>
<FIELDS>
</TRANSITION>
Make sure you don't have any <REQUIRED> for that field anywhere in the definition (there are a number of ways you can have that rule).
For reference, see http://msdn.microsoft.com/en-us/library/aa337653%28v=vs.80%29.aspx

Related

Can you add validation for swimlanes in TFS 2018?

I have a "Blocked" swimlane that I would like to add validation to. Specifically, I'd like to make a field required to be filled in when a backlog item is moved into this swimlane. Is this possible in TFS 2018? I've looked in the "TFS Process Template Editor" extension but I can't see how to do this. Thanks
Yes, it's possible, I prefer to do it with exportwitd and importwitd.
Export the work item XML with exportwitd.
Add a transition with your Blocked state and make a field required.
<TRANSITION from="In Progress" to="Blocked">
<REASONS>
<DEFAULTREASON value="Fixed"/>
</REASONS>
<FIELDS>
<FIELD refname="MyCorp.SomeField" >
<REQUIRED />
</FIELD>
</FIELDS>
</TRANSITION>`
Import the XML again to TFS with importwitd.
Now when a user moves the work item from "In Progress" to "Blocked" the field "MyCorp.SomeField" will be required.
You can find good documenation regarding above here, here and here.

TFS Assign Work Item By STATE ... with conditions

Our TFS is currently set up to assign a work item to our Tester (by capacity planning role) when the item goes from Active to Resolved state.
This is great, but it doesn't go far enough. When the Tester moves the item from Resolved to either Closed (tested and verified fixed) or Active (failed testing) I want to reassign the item back to whoever most recently transitioned it from Active to Resolved.
This way the person who fixed it is still associated with it when the defect is closed (get credit for your work) or if you didn't pass testing it gets reassigned back to the person that will be re-doing the work.
How can this be done?
Yes, your requirement can be achieved.
Automatically change AssignedTo field to a user when State field changes from Active to Resolved.
Assuming you have installed TFS Power Tool. You can modify the Transition from Active to Resolved (my example is from To Do to In Progress) by adding AssignedTo field and rules to this Transition:
The XML file should be like:
<Transition from="To Do" to="In Progress">
<ACTIONS>
<ACTION value="Microsoft.VSTS.Actions.StartWork" />
</ACTIONS>
<REASONS>
<DEFAULTREASON value="Work started" />
</REASONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<DEFAULT from="value" value="{Tester}" />
</FIELD>
</FIELDS>
</Transition>
In my example, when the State changes from To Do to In Progress, the AssignedTo field will change to Tester.
When the Tester changes State from Resolved to Active, the AssignedTo field will change back to whoever most recently change it
from Active to Resolved.
First, you need to customize a field to get ChangedBy value. In my example, I've customized a field named copy, the XML file looks like:
<FieldDefinition name="copy" refname="copy.copy" type="String">
<COPY from="field" field="System.ChangedBy" />
</FieldDefinition>
Then, similar to the item 1 above, you need to modify the Transition from Resolved to Active to (my example is from In Progress to To Do), the XML file looks like:
<Transition from="In Progress" to="To Do">
<ACTIONS>
<ACTION value="Microsoft.VSTS.Actions.StopWork" />
</ACTIONS>
<REASONS>
<DEFAULTREASON value="Work stopped" />
</REASONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<COPY from="field" field="copy.copy" />
</FIELD>
</FIELDS>
</Transition>
In my example, when the State changes from In Progress to To Do, the AssignedTo field will change to the user who change it most recently.
Might be there Solution for your question, but what I know is you don't need that just to see the person will be associate with it .
This is because if you see on right pane,when someone check-in the code for that work-item, or makes changes to that and saves the work-item ,automatically TFS shows in arrow with Steps continuously what have been done and by whom with date
and after failed testing. Developer who checked-in the code or try to solve that issue you can just select that developer name on dropdown on assign
I guess you were almost wanting similar the way i told but again if not forgive me.
Thanks,

TFS Transition Set System.AssignedTo from a string field

I am modifying a workflow in TFS 2013 and have bumped into a snag. Right now, when a developer completes their work and moves the work item into 'dev complete' I set the name of the developer moving the work item to a custom field as a string:
MYCOMPANY.Agile.Lean.CodeCompleteBy
<FIELD name="Code Completed By" refname="MYCOMPANY.Agile.Lean.CodeCompleteBy" type="String" reportable="dimension" syncnamechanges="true">
<ALLOWEXISTINGVALUE />
<HELPTEXT>The developer who wrote code related to this work item.</HELPTEXT>
</FIELD>
And here is the transition:
<TRANSITION from="Development in Progress" to="Code Review">
<REASONS>
<DEFAULTREASON value="Ready for Code Review" />
</REASONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<DEFAULT from="currentuser" />
</FIELD>
<FIELD refname="MYCOMPANY.Agile.Lean.CodeCompleteBy">
<DEFAULT from="currentuser" />
</FIELD>
</FIELDS>
</TRANSITION>
As the process continues the item eventually reaches QA. IF the QA person finds a problem and rejects the work then I have a transition to move the work item back into the 'Development in Progress' state. All of that works fine.
The Problem
I want to re-assign the work item, upon transition from QA in Progress back to Development in Progress, back to the original developer who did the work.
<TRANSITION from="QA in Progress" to="Development in Progress">
<REASONS>
<REASON value="Requirements Not Met" />
<REASON value="Rejected" />
<DEFAULTREASON value="Failed Testing" />
</REASONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<DEFAULT from="MYCOMPANY.Agile.Lean.CodeCompleteBy" />
</FIELD>
</FIELDS>
</TRANSITION>
Unfortunately, when I attempt to apply my new WIT transitions it throws the following error:
TF212019: Work item tracking schema validation error at row 931, column 24: The 'from' attribute is invalid - The value 'MYCOMPANY.Agile.Lean.CodeCompleteBy' is invalid according to its datatype 'http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typelib:CopyFrom' - The Enumeration constraint failed.
TF237070: Importing the definition failed. The definition you are trying to import did not validate against the schema. Edit the definition, then try to import it again.
I see that this is an Enumeration constraint issue, but I'm not familiar enough with TFS internal workings to know how to get around the problem.
Does anyone have a slick way of accomplishing what I am trying to do (even if I just need a completely new approach)? I may just be going down the wrong path altogether.
Thanks!
Instead of using the default which will simply try and set that as the value, try using the Copy rule.
Something like this:
<TRANSITION from="QA in Progress" to="Development in Progress">
<REASONS>
<REASON value="Requirements Not Met" />
<REASON value="Rejected" />
<DEFAULTREASON value="Failed Testing" />
</REASONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<COPY from="field" field="MYCOMPANY.Agile.Lean.CodeCompleteBy" />
</FIELD>
</FIELDS>
</TRANSITION>
Update the syntax like following:
<DEFAULT from="field" field="MYCOMPANY.Agile.Lean.CodeCompleteBy"/>
Refer to this link for details: Define a default value or copy a value to a field

TFS 2013 auto assign to myself

My question is, if it is possible in the TFS 2013 Scrum process template, to make a work item (task) on the scrum board, automatically assign to myself when moving it from "to do" to "in progress"? Should it be possible to add this in the process template on TFS?
We are using an on premise TFS 2013 environment.
I thought I have seen the configuration somewhere but I can't find it on the internet (maybe I am using the wrong search keywords).
You will need to edit the process template for the Task Work Item Type Definition.
Use witadmin.exe exportwitd to download the Task definition
Find the Transition from "To Do" to "In Progress" and change it like so:
<TRANSITION from="To Do" to="In Progress">
<ACTIONS>
<ACTION value="Microsoft.VSTS.Actions.StartWork" />
</ACTIONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<COPY from="currentuser" />
</FIELD>
</FIELDS>
<REASONS>
<DEFAULTREASON value="Work started" />
</REASONS>
</TRANSITION>
Use witadmin.exe importwitd to re-import the Task definition.

TFS Workitems always leave 'Closed By' blank

We have a TFS workitem workflow where developers set workitems to be 'done'. It is largely our of the box with little custom configuration. This populates the 'Closed Date' but not 'Closed By'. The workflow continues as testers assign it to themselves and set the state to be 'Tested', but now I can no longer see on a report which developer closed the item.
How can I get a report of who did the work?
Given that you have a "Tested" state, it seems that the transitions have been customized. Ensure that all transitions to the "Closed" state have the correct rule on them to update the "Closed By" field. The Closed By definition on the transition should look something like this:
<STATE value="Closed">
<FIELDS>
....
<FIELD refname="Microsoft.VSTS.Common.ClosedBy">
<ALLOWEXISTINGVALUE />
<COPY from="currentuser" />
<VALIDUSER />
<REQUIRED />
</FIELD>
....
</FIELDS>
</STATE>
More information on customizing work item transitions can be found here and here.

Resources