Azure DevOps Tips & Tricks 2 : Create child tasks automatically

Hello Guys… Welcome back to Azure DevOps Tips and Tricks series.

In last article we discussed how to use templates in Azure DevOps. Today we are going to discuss on how to create child links using predefined templates by a single click.

Assume a scenario that you have predefined tasks for Product Backlog Items or a Bugs as follows:

Each time you are creating a Bug or a Product Backlog Item, you have to make sure you add each of these child tasks to them in order to cover the activities under them. This become tedious when you have to repeat this several times a day.

In order to automate the child task creation, Visual studio Marketplace has a really cool Azure board extension named 1-Click Child-Links.

Lets see how we can get it configured.

Note: you need to have admin permission to get the extension installed. If you do not have permissions, request the admin user to get it installed it for you.

Once you have installed the extension, you should be able to see following option in your PBIs / Bugs

Now the extension is installed. The next task is to create your Child templates for Product Backlog Items and Bugs.

3. Navigate to Template definition page under project settings.

Project Settings → Team Configuration → Templates

4. Now lets see how we can create the sub tasks for Product Backlog Items first. We had following 6 sub tasks for PBI.

Click on “+ New template” button and fill the details as required.

As you can see above, you can mention all the fields that you need to automatically add to the sub task when its getting created. (Ex: Title / Tags / Area path)

Repeat the same for all the sub tasks required for Product backlog item.

Now go back to the Backlog and create a new PBI and add these automatic tasks to your PBI by following as mentioned below.

Yey!!!! Now we know how to create sub tasks automatically for a PBI. But when it comes to the real situation, you know the sub tasks are different from PBI to Bug. In our case, we add “Fix” & “Verify” tasks for Bugs.

How can we create set of sub tasks templates and add them to the parent based on the work item type of Parent?

This extension provides that capability also. It is a matter of adding the work item type of the parent in to the “Description” field of the template as follows.

Add this description for all task templates as follows:

Above is the simplest way to decide which sub tasks to be added for a Work Item. If you want to decide the sub tasks based on the parent Work item state and tags, its a mater of adding it in following JSON Template, copy and paste it to the Description field as we did before.

{
"applywhen":
{
"System.State": "Approved",
"System.Tags" : ["CustomerBug", "Product1"],
"System.WorkItemType": "Product Backlog Item"
}
}

That’s it :-)

Now you know how you create your child tasks automatically for the Bugs and Product Backlog Items.

See you again soon in another Tip……….

Reference : https://marketplace.visualstudio.com/items?itemName=ruifig.vsts-work-item-one-click-child-links