1

当编辑与他们相关的 WorkItems 时,我需要让所有未收到电子邮件警报的用户。我认为,TFS 提供基于某种事件的警报,并且每个用户都必须是特定事件的订阅者。

我可以使用下面的代码获取所有事件

IEventService es = tfs.GetService(typeof(IEventService)) as IEventService;
Subscription[] events = es.GetAllEventSubscriptions();

之后我提取所有身份

IGroupSecurityService gss = (IGroupSecurityService)tfsIdent.GetService(typeof(IGroupSecurityService));
Identity SIDS = gss.ReadIdentity(SearchFactor.AccountName, "Project Collection Valid Users", QueryMembership.Expanded);
Identity[] UserId = gss.ReadIdentities(SearchFactor.Sid, SIDS.Members, QueryMembership.Direct);

最后一步,我从用户 ID 中提取所有用户,其中电子邮件不会出现在事件中的任何事件中,我得到一个新的用户列表。

我问了列表中的一些用户是否设置了警报,他们证明了。

谁能指出我正确的方向来获取未订阅 WorkItemChangeEvent 的 TFS 用户列表。

PS:对不起我的英语不好。

4

1 回答 1

1

您调用的服务将返回您有权查看的所有事件。如果您想要所有事件,则需要创建一个具有适当权限的帐户。

于 2015-02-03T17:18:41.913 回答