I am currently looking for best practices to implement as use case in VSTS
Details below
1) Our board has several tfs work items and these work items can have multiple states example : 'Ready for build', 'Ready for deployment' etc
2) Based on the changes made to work item, is it possible to trigger a build ?
For example if the workitem is moved to 'Ready for deployment' state, a deployment build should be triggered
In other words how can we trigger builds based on changes to a work item ?
You can use web hook to trigger builds when work item states are changes.
Prerequisites as below:
Detail steps as below:
Ready to build
,Ready to deployment
etc.Configure a service hook:
In the team project -> Services Hooks -> Create subscription -> Web Hooks -> Next -> select Work item updated as trigger on this type of event -> filter Field as State -> Next -> input your website’s URL -> Test -> make sure it can work successful -> Finish.
Develop your own website with below functions:
Check the current state of the work item updated. You can get a work item information by REST API, and the check the value for
System.State
.Trigger related build to queue. According to the value of
System.State
, queue different builds. Such as ifSystem.State
isReady to build
, then queue the build for this state.Besides, If you are using TFS (Team Foundation Server), you can deploy a plugin on the server. Similar as the method in How to notify users when workItem is changed in Team Foundation Server(TFS) 2015.