I'm looking for a way to determine what process template was used for a team project after it has been created. I can now only guess by looking at the work item types. I could not find any option in Visual Studio to retrieve this information. I need to know what processs template was used for team projects not created by myself.
If you check your work item type:
- Scrum = Product Backlog Item
- Agile = User Story
- CMMI = Requirement
For TFS 2010 & TFS 2012, you can follow below process to determine which process template a team project used:
- Go to Team Explorer;
- Open Documents folder;
- Process Guidance;
- Open ProcessGuidance.html, this will open specific Process Template documenation that your team project base on.
Refer to thread
There is no way to tell, in general. If you create (or edit) a process template, you can put an identifier into a property then you will be able to track which projects have your template(s)
To do this: Edit Classification\Classification.xml add a node: tasks/task/taskXml/properties/property like this:
<property name="templateName" value="myTemplate_1.0.1" />
Once you have projects created with this template, in the object model you will be able to pull this info from a project:
TfsTeamProjectCollection c = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(myuri);
WorkItemStore wis = tpc.GetService();
ICommonStructureService ICss = tpc.GetService();
foreach (Project p in wis.Projects)
{
string ProjectName = string.Empty;
string ProjectState = String.Empty;
int templateId = 0;
ProjectProperty[] ProjectProperties = null;
ICss.GetProjectProperties(p.Uri.ToString(), out ProjectName, out ProjectState, out templateId, out ProjectProperties);
Console.WriteLine("Project: {0}\tTemplate: {1}", ProjectName, ProjectProperties.Where(n => n.Name == "templateName").FirstOrDefault().Value);
}
templateId is always -1 so dont think that will help you.
Also - If you have the rights to, I recommend adding this property into all the templates (even the default templates) in your collection, so that you will be able to track the templates of all future projects. Don't know why they didn't put it in the default templates. (if enough people complain maybe they will)
I found another workaround: in SharePoint Central Administration you can see in the Site Collection list a comment that described the process template that was used. I was actually looking for a way to programatically retrieve it via the TFS API, but could not find it.
Using witadmin, you can list the work item types in the project. The /collection
parameter is the TPC url and the /p parameter is the project name. Here is an example (below). If you know the name of a work item type that is specific to a process template, then you know which process template is being used.
Output of command console from my test TFS:
D:\Program Files\Microsoft Team Foundation Server 2010\Tools>witadmin listwitd /collection:http://suluserver:8080/tfs/De
faultCollection /p:"First Team Project"
Bug
Shared Steps
Task
Test Case
User Story
Issue
Risk
User Scenario
Risk-Issue
For visual studio online, go to your collection profile page. You can see all the projects inside your collection including the process template information.
The URL format to your collection page should be: https://[accountname].visualstudio.com/[collectionname]/_admin
This is definitely late but here's a couple different resources I found while searching:
- If you have access to the TFS database: Determine Process Template SQL
- Open source WinForms application: https://github.com/renevanosnabrugge/TFS-ProcessTemplateVersionCheck
I don't know a fail proof way to find this out.
I would recommend the following: There is a exe called witexport.exe that can export the xml of a work item. You can then look through the xml to see what kind of template was used. (ie if the conchango template is used you will see references to it.)
To run it fire up the VS Command line prompt (in the start menu). Here is an example run:
witexport /f "C:\Type.xml" /t "http:\MyServer:8080" /p MyProject /n "Sprint BackLog Item"
来源:https://stackoverflow.com/questions/909223/how-to-determine-used-process-template-in-team-foundation-server-after-creation