TFS work items for tracking tasks - tfs

I'm using Visual Studio 2012 and TFS onlin. I have created a TFS project using "MSF for CMMI" process template because it allows devs to estimate tasks, specify the remaining, etc.
Questions:
1) How can make the estimation of the work item read only? I don't want anybody to change that value once it has been set.
2) I need to create a report that shows what each dev has done each week, indicating task and hours. I tested MS Project integration with TFS and it's great but some columns like start date and end date only exists in MS Project so I need to ask each developer when they have started and finished each task manually.
3) What reports do you recommend for tracking devs and tasks?
Thanks in advance.

Answering your first question: you'll have to modify Task work item type definition in TFS:
export existing definition using witadmin.exe tool (you can find it in your Visual Studio folder):
witadmin.exe exportwitd /collection:<collection URL> /p:<project name> /n:Task /f:task.xml
Modify exported xml by adding CANNOTLOSEVALUE and FROZEN rules to the Microsoft.VSTS.Scheduling.OriginalEstimate field definition:
<FIELD name="Original Estimate" refname="Microsoft.VSTS.Scheduling.OriginalEstimate" type="Double" reportable="measure" formula="sum">
<HELPTEXT>The original estimate of work required to complete the task (in person hours)</HELPTEXT>
<CANNOTLOSEVALUE />
<FROZEN />
</FIELD>
Import the updated xml back to TFS:
witadmin.exe importwitd /collection:<collection URL> /p:<project name> /f:task.xml

Related

How to add columns on the online sprint board

I'm trying to understand how to add columns on the web version of TFS for my latest sprint but can't find the options to do so.
Using the default model (To do, In progress, done) does not capture the complexity and need for my team so I need an extra column but do not know how to add it.
If someone could give me pointers on the web version of TFS that would be great.
The sprint board can't be customized through the UI a more complex sequence of steps is required, this involves exporting a couple of XML files, editing them end importing them back in:
Export the task WIT from TFS using witadmin exportwitd
Add the required State(s)
Add the required State transition(s)
Export the processconfig using witadmin exportprocessconfig
Update the task board configuration to add the new state(s)
Import the task WIT using witadmin importwitd
Import the processconfig using witadmin importprocessconfig
See:
Modify workflow
Add work item types
This is best performed on a (temporary) test Team project collection to finetine the process, you can then import the tested configuration into the existing project.

How to add a new Activity type to the Task work item in TFS 2018

I would like to do exactly what is being proposed in this question, but instead of VSTS, I'd like to do it in on a On-Premise TFS(2018):
"Is it possible to add a new Activity type on the Task work item in
VSTS and, if so, how can I do it? Thanks!"
I've followed the instructions explained here to export and modify my custom project template. However when I follow the instructions here(Step 5 of the original instructions) I get stuck at the "Configure Features" step, that does not appear in my implementation of TFS (Yes, my user account is part of "Project Collection Administrators"):
I'm sort of confused, there are people that claim this can't be done. In fact it's even stated in the process page:
"Changes you make to a process template will only apply to new team
projects. They will not affect existing team projects."
But the instructions clearly indicate that it can be, I just done see the "Configure features" link? The instructions indicate that the use case is after a TFS update, but if I just changed my custom template, how would I enable this, so I can implement my changes in the custom template?
Try below ways to achieve that:
Import, export, and manage work item types with witadmin
Export the specific work item type definition file (Task in your scenario). Run command prompt with administrator, if you are
using VS 2017, then cd C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team
Explorer
witadmin exportwitd /collection:http://server:8080/tfs/DefaultCollection /p:ProjectName
/f:C:\temp\MyTask.xml /n:Task
Edit the exported WIT definition file (xml) with text editor, add a new Activity Type (e.g.: TestActivity0727in below
sample)
like below:
Save the file and import to TFS with witadmin command:
witadmin importwitd /collection:http://server:8080/tfs/DefaultCollection /p:ProjectName
/f:C:\temp\MyTask.xml /n:Task
Refresh the page, now the new activity should be worked in Task
work item.
Edit with TFS Process Template Editor, reference below screenshot:
For VS 2017, install the extension TFS Process Template Editor
For VS 2015, just install Microsoft Visual Studio Team Foundation
Server 2015 Power Tools

TFS shows old cached team members in "Assigned To" field

I'm using TFS 2013 and the process editor templates. I am trying to add an "allowed values" rule for the "Assigned To" standard field so I entered "[Project]\Some TFS Team" in the the ListItem popup hopping that only members from this team will appear in the dropdownlist suggested values of this field.
Unfortunately the list showed old team members of this team and no matter I added or removed members to and from this team the dropdownlist keeps showing only the old data.
Here are the steps I tried to clear that cache:
1-restart everything (TFS, my machine, TFS server)
2-remove and re-add the rule
3-run witadmin rebuildcache from my machine
4-delete C:\Users\ ...\AppData\Local\Microsoft\Team Foundation\5.0\Cache folder
What else should I look for to make the TFS responsive?
Note:
The same old list also appears in the field in the TFS web access.
You need to remove the default ALLOWEXISTINGVALUE and VALIDUSER rule.
Just change the Assigned to filed context as below:
<FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true" reportable="dimension">
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="[Project]\Team0720" />
</ALLOWEDVALUES>
</FIELD>
Update:
Please try below items to narrow down the issue:
TFS doesn’t reflect changes in the AD immediately, you can try to
force sync the changes, See Neno’s blog post on the issue with a
tool TfsSyncIdentities.exe as solutions. And this article to synchronize TFS users with AD for your reference.
Try to create a new team, then add several
members to the team, then check the rule with this new team.
Have a check for other work item types, whether they have the same issue.
Have a check for another team project, to check if it works.
#Andy-MSFT it looked like it took years from me to figure out what was the issue- maybe because I didn't logged into the TFS server itself -as I ran TfsSyncIdentities.exe tool to enforce the AD sync then run it again with /status option to check I found that it didn't run , only then I know that the Job agent service is stopped!!, and just after I restarted it everything worked as dreams and TFS responding to all the changes
note:
I had to stop it again because the TFS became toooooo slow when the job agent was running
Thanks Andy for you help and support

TFS 2017 Work Item Forms (new) - conversion from TFVC, now missing Development section on form

Running on TFS 2017, recently upgraded from 2015.
Soon after the upgrade I started to convert my existing TFVC repositories to Git. So far all is going well on that side, however what's puzzled me now is that the Work Item Task form seems to be incorrect\based upon TFVC.
I am using the new forms that come with 2017 and a Playground collection I also have displays the correct form.
The attach screen shots will probably explain it a lot better than words:
I don't want this:
This is what I'm expecting:
As you can see, the first one is missing the Development Group shown in the second, that makes creating Pull requests etc so much easier.
So, what am I missing here?
I should add that the Playground was created on TFS 2017, the other collection with the missing Development header was from a 2015 instance. I'm assuming there's some sort of setting somewhere that might need to be changed - either on the GUI or witadmin. Either that or this just isn't possible and I'm basically stuck. If it is witadmin then I'd appreciate more than a reply telling me it is since that command confuses the heebies out of me.
Actually the missing group on the work item form has nothing to do with moving from TFVC to Git.
It's caused by the automatic conversion of the old work item form to the new web layout style.
Unfortunately the TFS Power Tools template editor doesn't support the new layout, yet. So you need to edit the process template XML files by hand.
First thing you have to do, is to export your work item type configuration using the witadmin.exe tool as described here: Import, export, and manage work item types
In the file go to the <WebLayout> section. Just for the missing development group add the following to the last <Section> element:
<Group Label="Development">
<Control Type="LinksControl" Name="Development">
<LinksControlOptions ViewMode="Dynamic" ZeroDataExperience="Development" ShowCallToAction="true">
<ListViewOptions GroupLinks="false"></ListViewOptions>
<LinkFilters>
<ExternalLinkFilter Type="Build" />
<ExternalLinkFilter Type="Pull Request" />
<ExternalLinkFilter Type="Branch" />
<ExternalLinkFilter Type="Fixed in Commit" />
<ExternalLinkFilter Type="Fixed in Changeset" />
<ExternalLinkFilter Type="Source Code File" />
</LinkFilters>
</LinksControlOptions>
</Control>
</Group>
From my experience this is not the only thing that's missing on the form. To get the same look as in the newly created (on TFS 2017) project, I exported the standard process template my process template is based on (e.g. Scrum, HowTo) and copied the whole <WebLayout> element to my Task.xml. Afterwards I added my customizations and uploaded the WITD to the project.
You can try to create a new team project collection in TFS 2017 and create a new Git team project, then migrate the TFVC repositories to the new created Git team project. Then you'll be able to use the new form on TFS web access.

How to add columns in sprint board TFS (not backlog board)

In the newer versions I can customize the product backlog board by adding columns and set states. I want to do the same in the sprint board but I can't find that functionality. I've change the way you can work with Bugs but it still don't give me the options I want.
Pls Help
Not possible for Visual Studio Team Services(VSO) but for on-premise it is and is the same process since at least TFS 2012.
You will need to alter your process template for the Team Project to include the additional states. You can do this with either TFS Power Tools or I prefer to do it manually. You didn't specify what Process Template you are using so here it is for the SCRUM template (Others will be the same just will contain different wordings):
Export your WITD for Tasks from your dev machine via command line (I think it needs Team Explorer):
witadmin exportwitd /collection:http://servername:8080/tfs/DefaultCollection /p:"TeamProjectName" /n:Task /f:"C:\FileToExportTo.xml"
Edit this file and find the WORKFLOW section and add in your new state into STATES e.g:
<STATE value="New State" />
Next, in the TRANSITIONS section add in the required transitions and any logic associated with it e.g:
<TRANSITION from="In Progress" to="New State">
<REASONS>
<DEFAULTREASON value="New State Started" />
</REASONS>
</TRANSITION>
Save the file and import it again:
witadmin importwitd /collection:http://servername:8080/tfs /p:"TeamProjectName" /f:"C:\FileToExportTo.xml"
You should export your entire process template and you should add those files to source control. If you want to do the same for Bugs or any other work item type then you will need to export and modify those WITD's too.

Resources