How can you add a new work item into TFS from your own applications:
- Download & install Visual Studio SDK from the Microsoft web site
- Add the following references to your project:
o Microsoft.TeamFoundation.WorkItemTracking.Client
o Microsoft.TeamFoundation.Client
o Microsoft.TeamFoundation.Clommon
- Add the following lines to the top of the class:
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
- Access TFS:
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("Your serve name");
- Access the TFS work item store. The store contains information about all the work items that you have in TFS
WorkItemStore workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
- Access the project that you are interesting in:
Project project = workItemStore.Projects["Your project name"];
- Get the work item information that you are interesting in:
WorkItemType workItemType = project.WorkItemTypes["Task"];
- Create a new instance of the work items object that you want to modify. This allows you to access the work item property via the code
WorkItem workItem = new WorkItem(workItemType);
- Populate the work item:
workItem.Title = "Title test";
workItem.Description = "this is a test";
- Submit the new work item to the server
workItem.Save();
Additional info: http://msdn2.microsoft.com/en-us/library/bb130347(VS.80).aspx