For those Microsoft 365 changes that need a project to implement
Published Feb 22 2021 03:02 PM 6,325 Views

*** 4/27/2021 - If you have used this and get the "Resource not found for segment" error, then this means you are using the new Dataverse connector which expects the OData format for the record and not just the GUID.  I've updated below to reflect this ***


This blog post grew out of a conversation with one of my Microsoft colleagues about how one would push a Planner task to Azure DevOps - and the scenario was that they are very happy with the Message Center to Planner integration as a means to triage changes as they come through - but to actually execute on the changes they would normally use Azure DevOps.  So I got my thinking cap on and took a look at what was available in Power Automate.

Planner is somewhat limited in direct actions and triggers, but of course you can use the Graph API too once you get a Flow started - but the trigger is what you need here and I wanted to avoid a timer job just looking in Planner.  The "On completed" trigger seemed like the best approach, as if you were carrying out the work in Azure DevOps (or Project) then the plan task could be closed.  Then with the number of supported labels increasing in the very near future I thought that, combined with a complete task, would get me started.




Power Automate then has an action to read the Planner labels, so I could check if the task needed to go to Azure DevOps - and if so use the "Create a work item" action.




In this example I decided to create as a Feature - and in the description I crafted a link that would navigate back to the Planner task to get the full information.  A proper job here would probably involve a few more steps to read the information and populate it into Azure DevOps, but as a quick proof of concept it worked for what I needed.




And here is my newly created Azure DevOps feature.

My next thought was - that nice - but what if I want to use Project Online or the new Project to manage a Microsoft 365 change?  (The eagle eyed may have already seen the :Send to Project Online and Send to PfW in my labels list) so I extended my Flow to also look at those labels and react accordingly.




It is important to mention here that I am creating these as projects in Project Online and Project for the web - and not as tasks - as the assumption is that you would use this when you needed more than just a task (otherwise why not leave in Planner?).  Likewise for Azure DevOps - I created a feature but there may well be other entities added to deliver the change.

For the examples I've used I'll admit that these could probably just have been handled in Planner - as I can't imagine our adding of text predictions justifies a complete project plan to ready users...



And in the new Project we see the other task turned to a plan - in this case in a different environment than the default using the new flexible deployments option.



The Flow was pretty basic adding these two too - just a condition driven by the label that was applied, then the Create a new Project for Project Online (as the description doesn't support HTML I didn't create the href):


 and for the new Project in the Dataverse environment I used the following:


(updated 4/27/201 with new Dataverse connector details)  With the new Dataverse connector the "add a new row" option expects the OData format, so I used the Get a new row by ID to get the 4 required fields:


Dataverse get rows by IDDataverse get rows by ID

Then for each field in the dynamic content section I can get the OData id which is the right format.  I think I could also hard-code to the plural table name and the GUID - which might save some calls.  Note that the 4 OData id's are different - and selected from the appropriate section in the dynamic content.

New add rows dialog - using OData id formatNew add rows dialog - using OData id format

The tricky piece here was working out what the GUIDs needed to be, and I used the option to open the datasets in Excel to get a good look at the GUIDs so I could test out and confirm what these needed to be.  You can do this (permissions allowing) by going to, selecting the environment, then under Data, Tables select the table of interest (set filter to "All") then use the "Edit data in Excel option (don't get too excited - you can't really edit the data for this Project stuff in Excel).

Calendar Id can be found from the Calendar column of the Work template table – in my case I only had one work template, the default – so not problem using just this one – you might need to have some way to choose if your config is more complex.

Contracting Unit can be found as the Contracting Unit column in the Project table – and again I just had one so ok to hard code – your mileage may vary (Don’t confuse it with the Contracting Unit (Lookup) field…).

Project Manager comes from the Project Manager column in the Project table, and has its origins in the User table and the User column.  It is NOT the same as the AAD GUID.

Like the Azure DevOps example you'd probably want to add a few more steps to pull more information in - and I did skip a big "gotcha" on the Project Online side - as Project Online does not allow certain characters in a Project name I chose my example carefully.  You'd need to swap out any occurenace of the following characters - : .(period) \ " / : ; | ? ' < > * # ~ % { } +.  

Finally - a screenshot of the whole Flow (before the new Dataverse connector stuff which is shown above):



Let me know what you think - and what would make managing Microsoft 365 changes easier?





1 Comment
Version history
Last update:
‎Apr 27 2021 11:15 AM
Updated by: