Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用C#获取TFS中每个用户的所有事件订阅?_C#_Tfs_Tfs Workitem_Tfs Alerts - Fatal编程技术网

如何使用C#获取TFS中每个用户的所有事件订阅?

如何使用C#获取TFS中每个用户的所有事件订阅?,c#,tfs,tfs-workitem,tfs-alerts,C#,Tfs,Tfs Workitem,Tfs Alerts,我有一个要求,当与他们相关的工作项被编辑时,让所有没有收到电子邮件的用户都收到alerets。 正如我所说,TFS提供基于某种事件的警报,每个用户都必须是特定事件的订户 我可以使用下面的代码获取所有事件 IEventService es = tfs.GetService(typeof(IEventService)) as IEventService; Subscription[] events = es.GetAllEventSubscriptions(); 在那之后,我免除所有身份 IGro

我有一个要求,当与他们相关的工作项被编辑时,让所有没有收到电子邮件的用户都收到alerets。 正如我所说,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);
最后一步,我从UserId中提取所有用户,这些用户的电子邮件在事件的任何事件中都不会出现,然后我得到一个新的用户列表

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

有人能告诉我一个正确的方向吗?请列出没有订阅WorkItemChangeEvent的TFS用户列表


PS:对不起,我的英语很差

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