How to determine used process template in Team Foundation Server after creation of team project

北城以北 提交于 2019-11-30 04:42:46

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:

  1. Go to Team Explorer;
  2. Open Documents folder;
  3. Process Guidance;
  4. 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.

Su Llewellyn

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:

  1. If you have access to the TFS database: Determine Process Template SQL
  2. 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"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!