{"id":553,"date":"2011-10-31T07:19:27","date_gmt":"2011-10-31T07:19:27","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/buckh\/2011\/10\/31\/how-to-subscribe-to-checkins-not-under-a-particular-path\/"},"modified":"2011-10-31T07:19:27","modified_gmt":"2011-10-31T07:19:27","slug":"how-to-subscribe-to-checkins-not-under-a-particular-path","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/buckh\/how-to-subscribe-to-checkins-not-under-a-particular-path\/","title":{"rendered":"How to subscribe to checkins not under a particular path"},"content":{"rendered":"<p>Nick Kirchem, who works on the TFS web access team, recently answered a question on how email subscriptions on checkin alerts.&#160; The question was, how do I subscribe to checkin alerts <em>not <\/em>under a particular folder?<\/p>\n<p>Here\u2019s how to do it.<\/p>\n<blockquote>\n<p>bissubscribe \/eventType CheckinEvent \/address someone@domain.com \/deliveryType EmailHtml \/server http:\/\/myserver:8080\/tfs\/DefaultCollection &quot;&#8217;Artifacts\/Artifact[@ArtifactType=\\&quot;VersionedItem\\&quot;][not(starts-with(translate(@ServerItem, \\&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ\\&quot;, \\&quot;abcdefghijklmnopqrstuvwxyz\\&quot;), \\&quot;$\/devdiv\/feature\/build\/qa\\&quot;))]&#8217; &lt;&gt; null&quot;<\/p>\n<\/blockquote>\n<p>Let\u2019s break it down.<\/p>\n<ul>\n<li> \/eventType \u2013 Here we want CheckinEvent.&#160; There are others.&#160; Rather than list them, I\u2019d recommend the Alerts Explorer that is part of the Team Foundation Server Power Tools.&#160; You can use it to discover more, as each different type has different things you can filter on.<\/li>\n<li>\/address \u2013 The email address to use.<\/li>\n<li>\/deliveryType \u2013 We want HTML-formatted email.<\/li>\n<li>\/server \u2013 Here I\u2019ve used the URL to the default collection on a TFS 2010 server.&#160; You\u2019ll need to edit it to match the server and collection you need to use.<\/li>\n<li>expression \u2013 The expression is somewhat hard to read.<\/li>\n<ul>\n<li>The path we want to filter out is listed last, which $\/devdiv\/feature\/build\/qa in this case.&#160; You must use lowercase for your path.<\/li>\n<li>The translate XPath function is used to normalize the casing of the server path to be all lower case.&#160; This is important because XPath is case sensitive.<\/li>\n<li>The starts-with XPath function tests to see if the path is one we are interested in (in this case to filter out).<\/li>\n<li>The not XPath function inverts the test to see if it is not under the path we want to filter out.<\/li>\n<li>The quotation marks are escaped so that they can be inside quotation marks on the Windows command prompt.<\/li>\n<\/ul>\n<\/ul>\n<p>I recommend using the <a href=\"http:\/\/www.edsquared.com\/2010\/02\/25\/Where+Is+The+Alerts+Editor+Explorer+In+The+TFS+2010+Power+Tools.aspx\">Alerts Explorer<\/a> <a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/c255a1e4-04ba-4f68-8f4e-cd473d6b971f\">power tool<\/a> rather than doing this by hand.&#160; However, in this case, the Alerts Explorer does not support this.<\/p>\n<p>Nick has also written a feature for TFS 11 to allow you to edit alerts inside the product through the web interface.&#160; An early version of it is in the TFS 11 CTP release that came out in concert with the Windows\u2019 \/\/build conference.&#160; Here\u2019s a screen shot of it.&#160; Note that you can only see it in the UI if you enable email in the TFS Administration Console.&#160; Since then he\u2019s made it easier to use and made it so that you can administer other user alerts, if you are an administrator.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/39\/2019\/03\/6366.image_7D4A62E7.png\"><img decoding=\"async\" style=\"border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/39\/2019\/03\/7652.image_thumb_67144795.png\" width=\"1019\" height=\"623\" \/><\/a><\/p>\n<p>Related post: <a href=\"http:\/\/blogs.msdn.com\/b\/buckh\/archive\/2006\/09\/29\/checkinevent-path-filter.aspx\">Adding a path filter to a CheckinEvent subscription using bissubscribe<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nick Kirchem, who works on the TFS web access team, recently answered a question on how email subscriptions on checkin alerts.&#160; The question was, how do I subscribe to checkin alerts not under a particular folder? Here\u2019s how to do it. bissubscribe \/eventType CheckinEvent \/address someone@domain.com \/deliveryType EmailHtml \/server http:\/\/myserver:8080\/tfs\/DefaultCollection &quot;&#8217;Artifacts\/Artifact[@ArtifactType=\\&quot;VersionedItem\\&quot;][not(starts-with(translate(@ServerItem, \\&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ\\&quot;, \\&quot;abcdefghijklmnopqrstuvwxyz\\&quot;), \\&quot;$\/devdiv\/feature\/build\/qa\\&quot;))]&#8217; &lt;&gt; [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":10268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[8,11,15],"class_list":["post-553","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-team-foundation","tag-tfs-2010","tag-tfs-api"],"acf":[],"blog_post_summary":"<p>Nick Kirchem, who works on the TFS web access team, recently answered a question on how email subscriptions on checkin alerts.&#160; The question was, how do I subscribe to checkin alerts not under a particular folder? Here\u2019s how to do it. bissubscribe \/eventType CheckinEvent \/address someone@domain.com \/deliveryType EmailHtml \/server http:\/\/myserver:8080\/tfs\/DefaultCollection &quot;&#8217;Artifacts\/Artifact[@ArtifactType=\\&quot;VersionedItem\\&quot;][not(starts-with(translate(@ServerItem, \\&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ\\&quot;, \\&quot;abcdefghijklmnopqrstuvwxyz\\&quot;), \\&quot;$\/devdiv\/feature\/build\/qa\\&quot;))]&#8217; &lt;&gt; [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/comments?post=553"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media\/10268"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}