Thursday, April 26, 2012 9:25 AM
I'm using TFS API in my Console Application.
Here is the code snippet of openning a bug in my work.
TeamFoundationServer tfs = new TeamFoundationServer(myUrl); WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore)); Project project = store.Projects[myProjectName]; WorkItemType workItemType = project.WorkItemTypes["Bug"]; WorkItem workItem = new WorkItem(workItemType); workItem.Title = "Test"; workItem.Description = "Test Open Bug"; //Set value for other fields... workItem.Save();
And here is a question,:
In my work, all the bugs get CreatedBy == myName.
But in fact, I want to set different CreatedBy value for different branch. And it is impossible to change this directly since the Created by field of the work item is a read only field.
So, I wonder if there is other solution for my problem.
Thursday, April 26, 2012 9:36 AM
What you could do is to close the connection and open it again with that other user that you want to use for another branch and then create WI's. In that case you'll get the Created By filed filled with the name/account that you want.
Please remember to mark the replies as answers if they help. --- Success, Damir
- Proposed As Answer by Lily_WuMicrosoft Contingent Staff, Moderator Friday, April 27, 2012 2:13 AM