cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phani
Microsoft
Microsoft

Mention person in azure devops work item

Is there any way to mention a owner of that work item in discussion section by adding some comments from flow 

7 REPLIES 7
Expiscornovus
Super User
Super User

Hi @Phani,

 

This should be possible via the Send an HTTP request to Azure DevOps action and the add Comment method of the Azure DevOps Rest API 6.0:

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

 

You can use a html in the text of comment to refer to mention the user. Use a hyperlink and the data-vss-mention with the specific userid of the devops user you want to mention.

 

Below is an example of that.
Replace ad96260c-ea80-6eeb-93b0-c942399631d0 by the correct userid.

 

{"text": "<div><a href=\"#\" data-vss-mention=\"version:2.0,ad96260c-ea80-6eeb-93b0-c942399631d0\">@John Doe</a>&nbsp; Test mentioning</div>"}

 

mentionincomment.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


@Expiscornovus : Thanks for the solution but how can we get the user guid ( I can only have their alias or fullname ) 

 

Phani
Microsoft
Microsoft

@Expiscornovus  : I got the user id using GETUser from AAD but even though have mentioned it , the user not getting any DevOps notifications email when someone mentioned you but they are getting same notification email when i manually tag them

Expiscornovus
Super User
Super User

Hi @Phani,

 

It is not the AAD id. It is the Object Id from the Azure DevOps user.


I found that in the Organization Settings > Manage Users. Used the developer toolbar to retrieve that id. Found it in the GetMemberEntitlementsBatch Post request in the Json response of that request.  

 

getobjectid.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


Phani
Microsoft
Microsoft

Hi @Expiscornovus 

Have done the same . I got the user object ID, using below api and used that in mention but it did not worked out 

 

Phani_0-1622564057718.png

 

Expiscornovus
Super User
Super User

Hi @Phani,

 

Apologies if I wasn't clear. But it is not the Azure Active Directory Object Id I am using, it is the Azure DevOps Object Id/User Id I am using in the mention, which is a different guid.

 

I believe you can also find it via the User Entitlements summary:

https://developercommunity.visualstudio.com/t/how-to-get-user-entitlement-api-userid-with-princi/858...

 



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


Here's how I solved getting the userid so I could have the correct userid value for the @mention. 

 

Use get work item call to find the assign to user's id.

 

2 min video - Mention API Azure DevOps - YouTube

 

"text": "<div><a href=\"#\" data-vss-mention=\"version:2.0,{variable}

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,063)