I am getting WorkItems from TFS using this code:
private static List<WorkItem> GetTfsWorkItems(string projectName)
{
Uri URI = new Uri("...", UriKind.Absolute);
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(URI);
WorkItemStore store = new WorkItemStore(tpc);
string query = $@"SELECT *
FROM WorkItems
WHERE [System.TeamProject] = '{projectName}'";
return store.Query(query).Cast<WorkItem>().ToList();
}
WorkItem have fields "CreatedBy" and "ChangedBy" both of which are strings with user's DisplayName. I am looking for way to get user's AccountName (or Sid) instead of it. Thanks in advance!