【问题标题】:TFS2015 - Display all shared and user owned notifications and their ownersTFS2015 - 显示所有共享和用户拥有的通知及其所有者
【发布时间】:2018-06-01 16:30:30
【问题描述】:

我正在尝试编写一个 SQL 查询,该查询将在 TFS 2015 On-Premise 上的更改通知中列出所有共享和用户拥有的 VSTS。根据我的研究,通知应该存储在 tbl_EventSubscription 表中,但那里没有关于事件是用户拥有还是共享的信息,只是订阅者的 SubscriptionID,我不知道在哪里搜索所有者。

如果有可能用 REST API 解决这个问题,它也会有所帮助。

任何帮助或指导将不胜感激。

【问题讨论】:

    标签: mysql tfs notifications tfs-2015


    【解决方案1】:

    不建议您直接深入 TFS 数据库。请勿对 TFS DB 进行任何更改,否则您可能会失去 Microsoft 的支持。

    由于您已经获得了 SubscriptionID,要找出“SubscriberId”列中 GUID 后面隐藏的用户身份,可以使用以下 SQL 语句:

    SELECT  es.Id, 
            es.EventType, 
            es.Expression, 
            sic.mail_address, 
            sic.computed_display_name 
    FROM    tbl_EventSubscription es 
    JOIN    [Tfs_Configuration].[dbo].tbl_security_identity_cache sic 
    ON      sic.tf_id = es.SubscriberId 
    WHERE   es.Id = 123
    

    更多详情请看这篇博客:Who created that TFS event subscription?

    【讨论】:

      【解决方案2】:

      好吧,我想我明白了:

         SELECT Notif.Id AS 'Notification Id',
                Notif.EventType AS 'Event Type',
                Notif.Classification AS 'Notification Classification',
                Const.IdentityDisplayName AS 'Notification Owner'
           FROM [Tfs_Development].[dbo].[tbl_EventSubscription] Notif
      LEFT JOIN [Tfs_Development].[dbo].[Constants] Const ON Const.TeamFoundationId = Notif.SubscriberId
       ORDER BY Notif.Id
      

      @PatrickLu-MSFT 我不知道为什么,但我在 Tfs_Configuration 中没有 tbl_security_identity_cache,但我在 Tfs_Development 中有它并且它是空的。我使用 Tfs_Configuration.dbo.tbl_Identity 作为用户名的参考,但它没有返回团队订阅者甚至一些用户的名称,所以最后我会使用我的解决方案。

      感谢您的帮助。

      【讨论】:

        猜你喜欢
        • 2023-03-26
        • 1970-01-01
        • 1970-01-01
        • 2020-08-19
        • 1970-01-01
        • 2014-10-21
        • 1970-01-01
        • 1970-01-01
        • 2020-08-01
        相关资源
        最近更新 更多