Tip: Create a VSTS Tasks based on GIT repository code push (EVENT)

This article is to demo the available features (Service Hooks | Web Hooks) in VSTS and other possibilities to avoid manual interventions. You can think about any best fits your needs at your environment. For now, let me create a VSTS Work Item (Task) automatically for the repository code push – I would like to capture all the information as a task.

Simple Steps

  1. Node on Windows.
  2. Create a web server using express framework.
  3. Create a route with POST method and play with your needs.
  4. Add the route URL in service hooks wizard.
  5. Push the code from client machine which fires the event and calls PowerShell script to create a VSTS work item.

PowerShell Script to Create a VSTS Task

Now, here comes the Node.js (POST Route Listener)

Here comes the fun part – Set up Service Hooks and Choose Code Pushed!  When I push code to my repository I get a Task created for me


Leave a Reply

Your email address will not be published. Required fields are marked *