Adding Comments in Azure DevOps Using Power Automate

This article and live stream is the second one I did regarding the extension of the Employee Ideas template in Dataverse for Teams.

It shows how we can add the question responses from the employee idea and add them as discussion comments in Azure DevOps using Power Automate.

The responses are in a separate table from the idea in the Dataverse. Fortunately, there's still a direct relationship to the idea..

With this relationship, we can use the Common Data Service (Current Environment Connector) to get the related responses using the List Records action.

We want to loop through each of the returned results and for each one set a string variable in the following format - <Instructions>: <Response Rating>.

We use the resulting string variable to populate the "Text" property of the comment.

To add each comment, we must use the 'Send an HTTP request to Azure DevOps' action of the Azure DevOps connector.

The URL we POST to is

<Project Name>/_apis/wit/workitems/<Id>comments?api-version=6.1-preview.3

Where <Project Name> is the project name in Azure DevOps and <Id> is the work item ID you created in the previous steps.

The body of the request contains just one property - the text we want to include in the comment -

{

"text": "<Text Variable>"

}

And that's it. When run, the Flow will add a comment for each question and response that is present in the Employee Ideas item.