adding comment and formatting with API Rest for azure Devops

robert 0 Reputation points
2024-06-04T10:40:29.9433333+00:00

Hello, I'd like to add formatted comment with rest API in powershell.

I try this :

$comment = [System.Net.WebUtility]::HtmlEncode(" Here is a new file with relevant information: $DDJ Relevant Information #@$%^&*")

$commentwithmention = "<div><a href="#">@User</a>$comment</div>" #9c48ef54-c54b-6049-98ab-982453ed3e4c

$body = @{

"text" = $commentwithmention

} | ConvertTo-Json

it worked ! but i can't format the text. i'd like to add formatting, Strong and italics on the "$DDJ Relevant Information"

The HTML balises are not interpreted, event with the HTML encoding.

This is possible please ?

Community Center Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,641 Reputation points Moderator
    2024-06-05T07:08:53.7233333+00:00

    @robert - Thanks for the question and using MS Q&A platform.

    Azure DevOps is currently not supported in the Microsoft Q&A platform; the supported products are listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

    In order to assist best on your query, I would request you to post your query in SO => Azure Devops dedicated support. Additionally, adding the [Azure] tag on SO will increase visibility as it is a Microsoft Sponsored tag.

    https://stackoverflow.com/questions/tagged/azure-devops

    OR

    Report any Azure Devops problems on Developer Community.

    This will assist you with a faster reply to your query.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.