Enter TFS Bug using TFS API
In my previous article I explained how to connect TFS using APIs available.
The article helped us to access all TFS Work Items for a given project.
http://www.dotnetspider.com/resources/28885-How-access-TFS-work-items-using-TFS-API.aspx
Here is extension to my previous article.I will try to create a BUG work item type for a give project using TFS API.
Once you are connected to TFS project use following function to create BUG work item.
function CrateBug()
{
WorkItem item = new WorkItem(project.WorkItemTypes["bug"]);
item.Title = "Title of the BUG;
item.AreaPath = "TFSProjectName";
item.State = "Active";
item.Description = "This is a Bug. Please fix";
item.Save();
}
Once you save the item , a bug will be created in the TFS project and will get one unique ID assigned to it. on Similar lines you can create Task work item type as well.