Requirements Traceability Query Issue


In the dsTfsUrl dataset for this report, the end of the query is this:

SELECT (SUBSTRING(@TfsWorkItemTrackingDisplayUrl, 1, (SELECT PATINDEX('%tfs%',@TfsWorkItemTrackingDisplayUrl))-1) + 'tfs') AS tfsPublicUrl

Our naming standards specify certain things, like function and environment in the machine name, so our two TFS servers are namned xxxxxxxxTFS001 and TFS901.

The string search above finds the first occurrence of TFS and stops there, creating invalid links.

By altering the search to include the leading and trailing slash, and adding the training slash to the "+ '/tfs'" String, it functions properly.

SELECT (SUBSTRING(@TfsWorkItemTrackingDisplayUrl, 1, (SELECT PATINDEX('%/tfs/%',@TfsWorkItemTrackingDisplayUrl))-1) + '/tfs') AS tfsPublicUrl

I would think we aren't the only ones to experience this little thing, but it's an easy fix.


briancjordan wrote Oct 27, 2013 at 3:08 PM

Yes, this is clearly a bug. I knew that the dsTfsUrl query was "brittle" at time I created it. I meant to get back to it as soon as possible. However, that did not happen. I have logged it as a bug in my GovDev project on the Team Foundation Service now that I am actively developing on the project (https://govdevfortfs.codeplex.com/discussions/395179).



wrote Oct 27, 2013 at 3:12 PM

wrote Oct 27, 2013 at 3:20 PM