Case: You are developing service, that should change some WorkItems in Team Foundation Server.
Service should set field ChangedBy properly.
collection1.EnsureAuthenticated();
var ims = collection1.GetService<IIdentityManagementService>();
var id = ims.ReadIdentity(IdentitySearchFactor.AccountName, "domain\\username", MembershipQuery.None, ReadIdentityOptions.None);
var collection = new TfsTeamProjectCollection(new Uri("http://tfs:8080/tfs/collection"), id.Descriptor);
-- OR --
WorkItem wi;
...
// Change Work Item
...
// Set ChangedBy Field
wi[CoreField.ChangedBy] = userName;
wi.Save();
Комментариев нет:
Отправить комментарий