I want attach a file to a work item of type bug.While saving bug details to server i have this attachement.can any body help me?
Thanks suneetha.
I want attach a file to a work item of type bug.While saving bug details to server i have this attachement.can any body help me?
Thanks suneetha.
If you download the Visual Studio SDK, there should be an example in there for working with Work Items and attachments using the TFS API.
TeamFoundationServer server = TeamFoundationServerFactory.GetServer("TFSRTM08");
WorkItemStore store = (WorkItemStore)server.GetService(typeof(WorkItemStore));
WorkItem workItem = store.Projects["ABC"].WorkItemTypes["Bug"].NewWorkItem();
//Set other work item properties.
workItem.Attachments.Add(new Attachment("C:\Temp\MyAttachment.txt", "Comment About Attachment"));
workItem.Save();