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

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

4 REPLIES 4
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

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!

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

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (3,005)