Run a Script after a Backlog Transition in TFS 2018 - tfs

I am working with TFS 2018.
I have a project in which I have some backlog Items. In my board I have the states: Proposed, Active, Resolved and closed.
I want to be able to run a script after an Item moves from the Active State to Resolved state.
Can you help me with this? How can I achieve that?
PS: I'd like to create new branches automatically and build pipelines and Also move a work Item to a given state and delete that branch afterwards? This is what I am looking for.

TFS does not support any internal triggers or automation script. But you may write your own based on Web Hooks. There is additional server plugins like TFS Aggregator.

Related

TFS Release Step Create Task

I'm converting our XAML build process to vNEXT build for our on-premise TFS 2017. One step I like to automate is the create a work item task for a specific user to execute after the release has been done. Is there a built in way to do this? I have a PowerShell script but I'd prefer not to use it if there is already a better way
No, there is still no out-of-the-box feature for this. Either using the REST api or the Client Object model in a powershell script just like you have done will do the trick.
You could also take a look at this similar question: How to have TFS automatically add certain tasks to new work items?, jessehouwing has provided a great answer.
Another way is using TFS Aggregator- a serverside pugin for TFS 2013
(update 2 and later) which has the ability to create new work items
based on rules. An example task can be found here:
https://github.com/tfsaggregator/tfsaggregator/wiki/Auto-Create-Children
Update
After go through the extension in VSTS marketplace (https://marketplace.visualstudio.com/) , there is also no existing task could do this. You may still use your powershell script or write your own extension.

TFS, Jenkins and how to update work items with build numbers

We are using TFS and the TFS Build Service. We are considering to migrate the Build service to Jenkins but we came across some issues. According to this site, there are some things that do not work very well with the TFS and Jenkins plugins. All of them we use a lot:
Associated Change sets – Team Build automatically associates a list of change sets that are included in the build
Associated Work Items – Team Build analysis the relationships and also associates Work Items with a build. Indeed it walks the work item tree (parent) and maintains that association in the chain.
Is this still true? We have this scenario:
A developer checks in a code that fix a bug or resolve a User Story. It does that by associating his check in with the work item ID.
His check in triggers a build that will associate the work item with his changeset. For bugs, the build will update the "Integrated in Build" field with the build number. We use this field to know in witch version the bug was fixed.
Is there any way to make Jenkins behave and do what TFS build service does?
Another option is to mix the two using dummy builds on the TFS side that set the records straight and kick-off the Jenkins' builds. Some hints
How to trigger Jenkins builds remotely and to pass parameters and “Fake” a TFS Build.
This approach requires a bit of effort but has many advantages:
No big-bang, use Jenkins opportunistically
Can continue using existing builds
Having a build identifier in TFS allows you an overall monitoring and to use the Test features
I have a VSTS build definition for one of our projects that requires jenkins to build, but we still have all our other products using VSTS natively. To maintain consistency, this build definition triggers a jenkins build. We configured the build definition to not sync code as jenkins will download it (save time) and not to publish the artifacts back to the agent (i have another script for that found here). This allows developers to continue to use git as normal, and the build/release process is consistent with our other products. Along with task tracking and such.

TFS 2012 Automatic workitem State Change

I defined new work item with tfs power tools on tfs 2012 server.
new work item name is cab. states: new, active, deployed, closed.
I linked (releated) two User Story to cab work item.
I want to automatic state change(closed) which linked user story when cab work item state changed(deployed)
how to? c# coding? tfs event service? workflow action? or any way?
I don't found article for this requrement
You cannot do this with pure WorkItem workflow.
I would use a Server plugin to trigger event. See this design.
Only downside is that you have to remeber adding and configuring this plugin on every AT node and after upgrade/migration of TFS.

TFS and Mantis Integration

I'd like to know if it's possible (and how, if anyone has ever done it before) to have Mantis Bug Tracker "tickets" automatically imported/transformed into TFS work items.
We use mantis to keep track of development and TFS as a Repo. Every check-in made to TFS must be associated with one work item. Right now, these two systems are not integrated which causes, for example, that the ticket 100 is relative to the work item 497 without no way of knowing that one is relative to the other.
I've looked at TFS Integration Tools but was unable to install it for some reason at this time.
So, how can I have an automation process that "imports" Mantis tickets into TFS work items automatically? Is this even possible?
There is a plugin for source integration which supports Git, SVN and Mercurial (experimental).
https://github.com/mantisbt-plugins/source-integration
I am not aware that there is something similar avalaible for TFS, but it should be no big problem to implement TFS integration based on the framework which is offered by the plugin.

Automatically change PBI's state to Done when all the associated tasks are Done in TFS 2012?

Spent a while trying to figure this one out as our old Scrum for Team systems template did this in previous version of TFS, however I can't find a way to make a PBI automatically change its state to Done when all the associated tasks are done in TFS 2012.
Thanks
I haven't seen an out-of-the-box solution, but TFS Aggregator is a plugin that is designed to handle this scenario.

Resources