Ordering automatically created tasks in Azure DevOps using Microsoft flow

I hope before coming here you might have read about and how to create multiple tasks automatically for a userstory but there was one particular problem regarding order of tasks there which can be easily solved by Azure DevOps Stack rank

Let us see how to set Stack Rank here and how to set it for each task independently so it comes one below another

Step 1 : Go to flow and create an update task after the trigger

Step 2: Enter the details as shown in the update task (Here since the StackRank would be null we are setting the stack rank to some value for the userstory

Step 3: Then again get the details of the updated WorkItem as we need to get the StackRank date of the parent

Step 4: Insert a new step for initializing a new variable called “StackRank” (we are going to call this in tasks)

Step 5: For each of the subitems, set the stack rank field by incrementing the stack rank of the parent workitem by 1 or 2 (like shown) .As shown below, I am taking the stack rank from “StackRank” variable rather than from the Trigger details

E.g If the parent workitem has stack rank something like 45, the child workitem here will have 46 and the next child will have 47 and then 48,49,50 (If we set like this then we would be able to get tasks in order)

Step 6 : Repeat Step 5 for all the child workitems so that your order is something like shown below

Now when you again create a user story, you can expect your flow to create tasks and arrange it in sequential order in Azure DevOps like

  1. Development
  2. Code Review
  3. Deployment
  4. QA TestCase Creation
  5. QA TestCase Execution

Step 7: Create a User Story and wait for the flow to get tasks created as the above order

This is a 3 part series which explain in detail about how to create tasks using flow. You can see all the articles below

1. How to Create Tasks using Microsoft flow
2. How to Create Multiple Tasks
3. How to Order Multiple created tasks using Microsoft Flow & Azure DevOps

If you any doubts contact me on Twitter @Ramanean or on @AzureDevOpsGuide

You may also like...