.NET Geeks
-Unleash Your Inner Geek!!!

Check in Overrides

It is possible to implement a policy on Team Foundation Server to require work items to be associated with check ins.  However, the developer does have the option to override this policy and check his or her code in anyway.  Visibility into overridden check ins is limited, but, TFS does store this in version control database.  Here is the query to retrieve this info:

select a.changesetid, b.CreationDate, c.Person, a.comment
from tbl_PolicyOverride a
    inner join tbl_ChangeSet b
        on a.ChangeSetId = b.ChangeSetId
    inner join tfsWarehouse..person c
        on b.OwnerId = c.__id

Here is a script that runs the send mail in sql for a daily retrieval of policy overrides:

declare @sub varchar(50)
set @sub = 'Daily Checkin Override Report for '+Convert(varchar(8),getdate(), 1)
EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'Mail',
    @recipients = '[emaillisthere]',
    @query = '
select convert(varchar(5),a.changesetid,1) as ID,
convert(varchar(8),b.CreationDate,1) as Date,
substring(c.Person,1,15) as Person,
substring(a.comment,1,70) as Comment
from tfsVersionControl..tbl_PolicyOverride a
    inner join tfsVersionControl..tbl_ChangeSet b
        on a.ChangeSetId = b.ChangeSetId
    inner join tfsWarehouse..person c
        on b.OwnerId = c.__id
where b.CreationDate >= convert(varchar(12),getdate(), 110)
' ,
    @query_result_width = 150,
    @subject = @sub,
    @attach_query_result_as_file = 0 ;


The TFS team has said a check in override report is scheduled for a future release.

Posted Jul 24 2006, 10:46 AM by jsmith
Filed under:
Powered by Community Server (Non-Commercial Edition), by Telligent Systems