Getting Azure DevOps tasks in To-Do with Flow

Microsoft Flow logo

Recently I’ve been working more with Azure DevOps within our team; we do our capacity planning and tasks (Work Items) in sprints. However, I also use mail as a sort of To-Do list. Since a few weeks, you can have Flagged Mails from your Exchange account added as an To-Do task. It even copies most content of the mail and flag status (Complete etc.), both will show the same status. And more recently Planner tasks can show up in the To-Do app.

I like to minimize places I have to monitor and that includes looking at several places for assigned tasks. Unfortunately Azure DevOps Work Items are not shown in To-Do app as of today. So, I want an automatic way to get those DevOps objects into my To-Do list. Is that possible? Well, yes!

I used Microsoft Flow in order to copy any newly assigned DevOps task to the To-Do list. Unfortunately (currently) no synchronization between the two objects, but I can live with. The benefit of having one aggregated list with all my tasks is greater than that downside. Obviously there are more ways and variations possible, but for that you might have to dig deeper into Flow.

Creating and configuring the Flow

First, go to https://flow.microsoft.com or via the waffle menu within you Office 365 browser session. You need to create a new Flow. There is a template for this scenario, but I like to break this down so in this case we will use “+ Automated – from blank”:

Pulldown menu when creating a new Flow

A new screen popups in which you can name the Flow and search for the first trigger. The trigger is the event the Flow watches for to be true and if so, perform the action(s) you have defined:

Choose the Flow name and the trigger

You might have to search and scroll for the correct trigger, in this case I’ve choose “Azure DevOps – When a work item is assigned”:

Choosing Azure DevOps as trigger

Select “Create” when you’re ready. Now are in the edit phase of this Flow. First you would have to specify the Azure DevOps account, Project and team: note that you could be part of multiple of them, so choose the correct one in order to get the correct work items.

Configuring the Azure DevOps trigger when Work Item is assigned

In my case I used these values:

Example of the Azure DevOps trigger when Work Item is assigned

The account name is the connection where your tenants Azure DevOps instances is hosted, it’s possible you get notified to authenticate to your Azure DevOps instances before you can select the Account. After that, it should be able to see the projects and specifically the Azure DevOps team you’re a member off. Note that this trigger is till in Preview, meaning that might be some kinks and issues with it. The “Assigned To” field is the field where you have to enter your (Azure DevOps) identity.

These are the most important values, but if you require even more granular approach or other things the Advanced Options might help with that. If you have configured and connected this first event trigger, the following would be to define the next step.

For this step, I’ve specifically chosen the “Add To-Do”. You can search for in it in the “Choose an action” step:

Choose the Action step Add To-Do

There are other options that would also result in tasks within To-Do (such as Outlook Tasks), however I’ve noticed this specific step has less issues with propagating certain Azure DevOps object information. After you added the “Add a to-do” action, you see this:

Empty To-Do action

Obviously you have to name the new To-Do, but the nice thing with Flow is that it has remembered the attributes of the Azure DevOps work item. You could compare it to object piping such as PowerShell cmdlets do. When you select the field, a new selection menu will appear:

Menu with Dynamic content options from Azure DevOps

You can already see some of the dynamic content options available and it depends on your preferences what kind of naming convention you want or require. In my case I decided to use the Work Item ID, Work Item Type and Title. It looks like this

Configuring the Subject with the Azure DevOps id, Work Item Type and Title and will result in this To-Do task: How the Azure DevOps values are used in the To-Do task

Using Reminder and Due Dates

For Microsoft Flow, the title is the bare minimal information required to create a successful Flow. However, I’m not that easily satisfied. My team works in two week long sprints, with a planning on Monday on which work items are assigned to team members. Our review is on the second Friday, which would be the ultimate deadline for those tasks. We can use that in our Flow and I have:

To-Do flow configured with Due, Reminder and Start dates using Expressions

What are those purple things, you say? I have configured the Due Date, Reminder Date-Time and the Start Date of the To-Do task, using Expressions.

The Start Date is the easiest as in this case it uses the current date, which would be the date this Flow is running and happens when a Work Item is assigned to my name. Just use the utcNow() expression, that will use the current date. When you select the Start Date field, a new menu will appear on the right side. Be sure to select the Expression tab and scroll down to the “Date and time” section and add that item to the field as shown below. That it’s!

Select the correct Expression in the menu at the right side

The Due Date and Reminder date are a little bit more complex. I’ve used the values I required, but YMMV obviously. The Due-Date will be the second Friday of our sprint to, which would be 11 days from planning (and when the Work Item is assigned). For the Reminder I choose a week later, so 7 days from planning.

Luckily there is a Expression that can add an integer of days to any value: addDays(). You can combine it with the utcNow() expression and add the amount of days you want, resulting in addDays(utcNow(),11) in the Expression field:

Combining multiple Expressions

For the Reminder date it would be addDays(utcNow(),7). You can obviously change that to suit your own needs or maybe even use different content or expressions.

And as you have seen in a previous screenshot, within To-Do you can see the effect of what we just did. The reminder is on a Monday and the Due Date is on a Friday, as was intended:Showing the To-Do with the added dates

Yes, the time is a bit late but it depends on when the Work Item is assigned and this was tested at 7pm. If you have your actual task planning and assigning at noon, the reminder will be at noon. It’s just one of those little things that might require some extra attention later by refining the Expression. Just like that if you get a Work Item assigned later in the week, the Due and Reminder dates are obviously not matching your sprint. Something for another time. Winking smile

Other useful information

There are situations you require to edit the original Work Item or need some more information in To-Do besides the name. The status of the To-Do is default on NotStarted and I guess that should remain so. The “To-do List” option is a great way to order all your To-Do’s in a specific list, not everybody will need it but it’s very good that the option is available.

The biggest field you can add additional useful data is “Body Content”. In my case I’ve added the Description, the Iteration (name of the sprint in DevOps), the direct URL and the creation date:

Adding additional info via Status, the Body Content field and the To-Do list it has to appear in

I think by now you should be able to construct this however you please, using the Dynamic Content menu. I felt the Description and the direct URL to the Azure DevOp Work Items are the most useful. The Body Content would look something like this (Windows 10 To-Do) and do note the clickable link (had to obfuscate the complete link, sorry):

The Body content of the To-Do task, showing content from the original Work Item

The formatting can use some work, but that also depends on the client capabilities. You can choose whether to use plain text or HTML, but for that option you have to click on “Show advanced options”:

Advanced options for the To-Do task, including HTML and reminder options

Unfortunately most HTML code isn’t processed. The Bold tag is useless as the Windows 10 To-Do app doesn’t show this. This could be true for more of the To-Do app, but perhaps that will change in time. Things to experiment with, I guess. Smile

As a final reminder: the “Is Reminder On” option is also hidden in the advanced option, but is important if you want to set the Remind date. So remember to turn that option on.

I hope you now have a good basis to use Microsoft Flow to aggregate your Azure DevOps items in Microsoft To-Do, making that app even more attractive as the task application. Unfortunately, this current flow doesn’t update the To-Do when the Work Item has changed. That might another project or feel free to comment below on ideas. Obviously the best solution would be a native integration from Microsoft which also would update bi-directional where possible, such as the Flagged Mails option.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.