cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Revlock97
Helper II
Helper II

Update Discussion/Comment in Azure DevOps Work Item via Adaptive Card

Hello I'm quite new Power Automate and I really can't solve how to add a discussion comment in a DevOps Bug . The available columns for updating a work item don't have the "Discussion" column and that's the field I wish to update. I'm using adaptive cards to change both the State and add discussion/comments to it but so far only the State column is available. Any help is appreciated thank you!

Revlock97_0-1655970255555.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Expiscornovus ,

Actually I found a way using the Other fields row and inputting "History" in the Key Value. It worked as intended.

I referenced it from here: https://powerusers.microsoft.com/t5/Building-Flows/Adding-a-comment-to-a-DevOps-Work-Item-using-a-gi... 

Revlock97_0-1656033671940.png

 

Which also lead to this problem: https://powerusers.microsoft.com/t5/General-Power-Automate/User-specific-Comments-in-Azure-work-item... 

 

But thank you so much! I'll also try this work around now 😁

View solution in original post

5 REPLIES 5
Expiscornovus
Super User
Super User

Hi @Revlock97,

 

As far as you cannot add a comment via the update item action. It does not have any field for this in the settings.

 

As a workaround you could use the Azure DevOps REST API together with a Send an HTTP request action (Azure DevOps connector). There is Add Comments method available in that API:

https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/comments/add?view=azure-devops-rest-7.1


Below is an example of that approach.

 

Relative URI

@{variables('Project')}/_apis/wit/workItems/@{outputs('Get_work_item_details')?['body/id']}/comments?api-version=7.1-preview.3

 

Body

{
  "text": "Hello World from Power Automate!"
}

 

comments_workitems.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Hello @Expiscornovus ,

Actually I found a way using the Other fields row and inputting "History" in the Key Value. It worked as intended.

I referenced it from here: https://powerusers.microsoft.com/t5/Building-Flows/Adding-a-comment-to-a-DevOps-Work-Item-using-a-gi... 

Revlock97_0-1656033671940.png

 

Which also lead to this problem: https://powerusers.microsoft.com/t5/General-Power-Automate/User-specific-Comments-in-Azure-work-item... 

 

But thank you so much! I'll also try this work around now 😁

Expiscornovus
Super User
Super User

Hi @Revlock97,

 

Great, I did not know it was possible via the History field.

 

I am definitely going to try that as well. Thanks for sharing!



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


ns522101
New Member

hello @Revlock97 @Expiscornovus can you please advise how you had {/}Output value in the History other field ? I don't think it is an expression. My requirement is to add a comment to a work item when any User Story drop down value is selected as show in screenshot#2. Please advise how to achieve this via PA?

 

screenshot#1

Revlock97_0-1656033671940.png

 

screenshot#2

Screenshot 2022-07-08 163234.png

From the reference linked here: https://powerusers.microsoft.com/t5/Building-Flows/Adding-a-comment-to-a-DevOps-Work-Item-using-a-gi...

 

In the other discussion the author indicated “The trigger is an email arriving, the formatted body is the ‘output’ seen in”

 

So the Output value was coming from the received email body (assumed) to be formatted as html…

 

1. I have not tested, but it seems that any string should be valid for a comment

2. if that string includes basic html wrapped in a paragraph tag it should apply the appropriate rich text formatting: <p>{html formatted text}</p>

good luck!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,793)