Skip to main content
Community site session details

Community site session details

Session Id : Lphw5J1dBlspdGwKoFsXXa
Power Automate - Building Flows
Unanswered

Update an existing comment in Azure DevOps

Like (0) ShareShare
ReportReport
Posted on 12 Aug 2022 13:27:14 by 11

Hello,

since there is no selection option in the column option on the part of DevOps, a workaround must be created.

The status of a work item and the last comment of the work item in a HTML table should be sent by email.

To make this possible, the last comment of the work item should be updated so that it appears first in the history.

 

Question:
How do I get the newest comment and update it? (so that the updated comment will be first in "history)

--> If there is a solution to update an existing comment, it will be a suitable workaround for a requested feature in DevOps:
Visual Studio Feedback

 

DGN_NB_0-1660310372054.png

⬇️

DGN_NB_1-1660310463871.png

 

  • DGN_NB Profile Picture
    11 on 18 Aug 2022 at 09:38:09
    Re: Update an existing comment in Azure DevOps

    Thanks you for your answer!
    Yes, your solution works to put the comment first in history (thats great!)
    Maybe I am doing something wrong, but with your solution the comment will be overwritten and replaced by the new text.

    --> Is there a change to 
    a) add a word to an existing comment without deleting the existing text (which will put the comment first in history)

    or

    b) just get an existing comment and force an update on that (so that it appears first in history) 

  • Expiscornovus Profile Picture
    32,187 Most Valuable Professional on 17 Aug 2022 at 16:03:34
    Re: Update an existing comment in Azure DevOps

    Hi @DGN_NB,

     

    Below is an example of how you can retrieve the newest comment and update it with your own text. I am using this example from the Azure DevOps documentation:

    https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/comments/update?view=azure-devops-rest-7.1&tabs=HTTP#update-a-comment

     

    In the example I am using this expression to get the correct comment id from the first HTTP request:

    body('Send_an_HTTP_request_to_Azure_DevOps')['comments'][0]['id']

     

    updatelastcomment.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete