Automation with the TFS web hook and REST services

At Associated Electric, we leverage Microsoft’s Team Foundation Server (TFS) for work tracking and a source code repository.  Over the years I have customized and built out work items to help me manage and stay on top of the work my team is doing.  I have also experimented with some of the forecasting and scheduling functions of TFS, i.e. burn downs, kanban boards, task boards, etc.  The challenge with many of these functions is that the data required to make them work can be intense.  A medium sized project may consist of a single TFS work item, with a dozen or so user stories and those user stories may have half a dozen tasks all requiring a half dozen or so fields just to communicate the work, who’s doing it, and when.  Getting a burn down and accurate forecasting in TFS requires at least another half dozen fields and if you don’t take the time to think about each of those fields having them won’t provide you with any value.  For a project like this you may easily spend a day to two just keying work items in to TFS, not a very exciting endeavor for an analyst or developer.  I just settled by using story points on the user stories and not bothering with the task level, but I was always hungry for more out of TFS.

Recently I had to spend an extended amount of time away from managing my team and when I returned, I discovered that things were not running as well as I would have hoped.  It is nothing against my team, they are just trying to execute on work the best they knew how.  It became obvious to me that I needed more insight into all the work going on in my team and they needed more clarity on priories.  Across my team there is a large range of work, everything from writing annual reviews, tier two user support, and implementing ASP.NET web applications.  The one thing that all work has in common is that it can all be abstracted into tasks.  Tasks that can be scheduled and prioritized in TFS.

I also discovered that in TFS 2015, there are service hooks including a generic web hook that can be called on work item creation and updates.  From there my creativity exploded.  All of my team’s project milestones and support requests are modeled as User Stories, and using the TFS REST APIs, I created a web hook that automatically created a child task for the implementation of the project milestone, or resolution of the support request.  I even plugged into the time tracking data we maintain to populate time estimates into these tasks based on the TFS area.  Doing that instantly enabled me to start leveraging the TFS Task board with accurate time estimates with absolutely no additional data entry.  I also implemented a web hook for work item updates to automatically close the parent user story when all child tasks are closed.  I created a second update action to propagate changes from the parent user story down to all active children, i.e. if you carry a user story forward into the next iteration, the iteration will automatically update for the remaining child tasks.  By automating this data entry, my team is now using the Task Board which give me a single place to review all the work going on and give me the opportunity to easily guide and correct work priorities for team members.  All of this is happening without any additional data entry on my part.  I’ve included the models that you can use to deserialize the JSON calls from the TFS Service hooks to help anyone else get started.



I hear this all the time

I recently an email from the Big Brothers Big Sisters of the Ozarks.  In case you don’t know, there is a shortage of willing big brothers to be good mentors and role models to the boys in the program.  In it, they identified one of the main reasons why men don’t volunteer is that “[they] have never been asked.”  Well, count this as me asking the men out there to step up, volunteer, and be a good mentor and role model to these children.  Poverty is a real, and often overlooked, problem in our community.  For the city of Springfield over 25% of this residents live below the poverty line, and it is even worse for our children.  For the Springfield public schools, over 50% (yes half) of the students qualify the free and reduced lunch program.  Don’t think that the surrounding communities fair much better.  For Nixa, 30%, for Ozark 30%, for Republic 37%, for Rogersville 30%, for Strafford 30%, for Willard 34%, of the high school students qualify for free and reduce lunches.  Those numbers are just for the high schools, the elementary and middle schools (and the districts as a whole) are higher.  In my life, education is what has opened up opportunities for me and it is education that will help reduce and eliminate the poverty problems that we have in our region.  Littles that go through the mentoring program are less likely to skip school, more likely to graduate high school and more likely to attend college.  I have the privilege of working for any employer that values helping the local communities that is has a presence in and backs that value up with corporate charitable giving and by encouraging employees to participate in an annual United Way payroll deduction.  Concern for Community is one the seven cooperative principles.  I will tell you that these things alone are not enough to solve the problems facing our community.  If they were, our community’s poverty rates would not be worse than state averages.  I would like to ask you to read the attached letter from the Big Brothers Big Sisters of the Ozarks; then, I would ask you to join me in helping make this community better for the next generation.


I hear this all the time