Wow, that title is a mouthful, isn’t it? I thought of shortening it by changing it to “PowerFortomatetoryOps”, but decided against it at the last moment. Do you like the current title a little more now (wink wink)? Coming back to the topic at hand though, we are going to automate the User Story creation process where we build a customer (or “Users”, as they are more commonly called) facing web form, that is going to take in requests and convert them into User Stories on the Azure DevOps platform.
This is going to help us in the following ways:
- All the ad-hoc requests by our customers can be created into User Stories, to help in effort tracking
- Customers don’t have to go through a complex ticketing system in order to request some work to be done.
- We won’t have to get distracted from our current work in progress because of pings by the customers
Tools of the Trade
The title kind of says it all, but here is everything that is going to be used in this process:
- Microsoft Forms
- Power Automate
- Azure DevOps
- Outlook (optional)
- Teams (optional)
Microsoft Forms
The first job involves creating a front end for our customers that’s easy to use and asks the right questions.
- Go to the Microsoft Forms web page.
- Click on New Form.
- Give a title to your form-> Click on Add new -> Select Choice -> Create your questionnaire based on what are the most common requests that you get.
Next, we will create different sections for different options mentioned in the questionnaire
- Click on Add new again, but this time, select Section.
- Inside the section, create more options of the Text type this time. The end result should look somewhat like this:
- Similarly, create sections for all the different choices.
- Control the flow of the form by changing the Branching.
- Preview your form to see if it’s working as expected
And your basic form is ready. Time to move on to the next step.
Power Automate
Once the form is ready, we need to use Power Automate in order to work with that ready and get it ready for Azure DevOps.
- Go to the Power Automate website
- Click on My flows -> New flow -> Automated Cloud Flow
- Fill in the following details
- Flow name – Give any name
- Choose your flow’s trigger – Search for “when a new response is submitted” and select the highlighted option
- Click on the Create button
- Select the form that you created in the Form Id section. This is going to fetch the unique value of the Response Id for that form. That value is going to be used in the next step.
- Add a new step and fill in the details as follows. Response Id will be the Dynamic content value of Response Id that we got from the previous step. Through this step, we have extracted the value of all the questions that were answered in the form.
Once we have gotten these details, we can move on to the Azure DevOps step.
- Create another step, this time selecting Azure DevOps as the connector and Create a work item as the action.
- Fill the details as follows:
- Organization Name – Filled automatically
- Project Name – Filled automatically
- Work Item Type – User Story
- Title – Write whatever you want. I have used the below format where we get the Request name and Customer email as dynamic content
- Description can be filled as mentioned below. Remember to add </br> in order to add a line break between the details.
- Advanced options can be filled as mentioned below. I will only focus on the dynamic and less obvious stuff.
- Iteration Path – Calculated through REST API. Explained later.
- Link URL (optional) – This will be the URL for the work item you want the User Story to be linked to. If you have a Feature that will track all the ad-hoc requests, then this will be it. URL needs to be filled in the following format:
https://dev.azure.com/OrganizationName/ProjectName/_workitems/_apis/wit/workItems/FeatureNumber
- Link Type (depends on Link URL) – Hierarchy-reverse (if you want the above URL as a parent)
Iteration Path
Coming back to Iteration Path, if you want to calculate its value dynamically, you’ll need to make use of REST APIs:
- Add another step (Send an HTTP request to Azure DevOps) and move it before the Create a work item step
- Fill in the values as follows:
- Organization Name – Filled automatically
- Method – GET
- Relative URI – https://dev.azure.com/OrganizationName/ProjectName/Area/_apis/work/teamsettings/iterations?$timeframe=current&api-version=6.0
- Go back to the Create a work item step and inside the Iteration Path section
- Inside Dynamic Content, click on the Expressions tab, paste the following expression, and click on OK.
outputs('Send_an_HTTP_request_to_Azure_DevOps')?['body']['value'][0]['path']
- That will hold the dynamic value of the current iteration and add it as the Iteration Path.
- You can check the flow by clicking on the Flow Checker button on the top right.
- You can then test the flow by clicking on the Test Button and selecting the Manual option. After doing that, just submit the form by filling in the details and come back to the flow page to see how the testing proceeded. If all goes well, you should have a User Story created in your Area Path with the details that you filled in the form.
Additional Information
- You can also add additional steps in the flow that sends an email to you along with a Teams notification on form submission. The steps are fairly straightforward and you should be able to work it out.
That’s it for this slightly lengthy post. I had to justify the length of the title with the length of this post, right?