2012年3月22日 下午 09:08Hi All,
I am trying to automate the process of reading data from a REST WEb service and creating a TFS task. I am using the TFS client object Model. I am trying to create a work item of type "task" but unable to save it because it requires the"Code Reviewer" Field to be set.However, I have no way of accessing it.
Here is my code : I am using VS 2010
static void Main(string args)
Uri collectionUri = (args.Length < 1) ?
new Uri("http://server:8080/tfs/DefaultCollection") : new Uri(args);
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(collectionUri);
WorkItemStore workItemStore = tpc.GetService<WorkItemStore>();
WorkItemTypeCollection workItemTypes = workItemStore.Projects["Servicing"].WorkItemTypes;
WorkItemType workItemType = workItemTypes["Task"];
WorkItem task = new WorkItem(workItemType );
task.Title = "Automated ";
task.Description = "Automated ";
I am stuck here.Can somebody please help??
2012年4月3日 上午 03:50
Hi, can you please post your question on the TFS WIT forum here: http://social.msdn.microsoft.com/Forums/en-US/tfsworkitemtracking/threads? If you are trying to set non core fields in the work item you can get them and set them by doing task.Fields["Code Reviewer"]. You can read more about the WorkItem class here http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.workitem.aspx.
Federico Kolliker Frers - MSFT