web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / @mention user in Azure...
Power Automate
Unanswered

@mention user in Azure DevOps work item discussion

(0) ShareShare
ReportReport
Posted on by 12

I'm building a flow which should end with a comment in the discussion field of an Azure DevOps work item tagging two people.
For now, I was trying with just one, and I can't get it to work: everytime it creates a hyperlink-looking text that doesn't mention the user - it's not bold and highlighted in grey and the user is also not receiving an e-mail notification.

 

I have looked through @jk10 (here) and @Phani 's (here) questions and @Expiscornovus 's answers and blog post to no avail. I believe @Magnus had the same issue but got no answer.

 

I have tried using both the user's e-mail or their display name. I have also tried getting the user ID with the Office 365 connector and using that (didn't work) and getting the user profile with the Azure DevOps connector to get that user's ID (both with e-mail - failed - and with the Office 365 ID output - ran in circles).

For my user ID I'm using my e-mail (does it make a difference? If I change it it stills posts as myself since it's my connection).

 

(Even though the screenshot has the Organization Name as empty I'm obviously testing it with it filled...)

 

Thank you for any tip you could spare!

Capture.PNG

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @RSSO93,

     

    You can use a search for User Entitlements HTTP request for this:

    https://learn.microsoft.com/en-us/rest/api/azure/devops/memberentitlementmanagement/user-entitlements/search-user-entitlements?view=azure-devops-rest-7.1

     

    Below is an example

    This does require the usage of an Personal Access Token.

     

    1. URI HTTP request

    https://vsaex.dev.azure.com/@{variables('OrgName')}/_apis/userentitlements?api-version=7.1-preview.1

     

    2. Filter Array matches a mail from a Get User Profile (v2) action profile

    @equals(item()['user']['mailAddress'], outputs('Get_user_profile_(V2)')?['body/mail'])

     

    3. POST HTTP request to update work item which uses the id and the displayname of the first matching user.

    {"text": "<div><a href=\"#\" data-vss-mention=\"version:2.0,@{first(body('Filter_Array'))['id']}\">@@{first(body('Filter_Array'))['user']['displayName']}</a>&nbsp; Test Comment with mention with user id lookup in User Entitlements</div>"}

     

    updateworkitem_mention_devops.png

     

    Test result

     

    testresult_devopsmentioning.png

  • RSSO93 Profile Picture
    12 on at

    Thank you for taking the time! However in the very first step I got a roadblock: "The user is not authorized to access this resource.".

    Is there any other way to do it?

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @RSSO93,

     

    Did you create a Personal Access Token in Azure DevOps? And what access scopes did you assign to this token?

    https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows#create-a-pat

     

    Also make sure you select the Basic option in the Authentication dropdown of your HTTP action and use the Organisation name and your access token in the Username and password fields.

  • RSSO93 Profile Picture
    12 on at

    Hello @Expiscornovus and thank you very much for your help.

     


    @Expiscornovus wrote:

    Did you create a Personal Access Token in Azure DevOps? And what access scopes did you assign to this token?


    I did not because I couldn't get over the fact that I wasn't able to get the guid to do this in an easier way, so I got it using a few comments also from you on other posts.

     

    Here's how: 

    1. Created a work item with the people I wanted to mention (they are always the same) in "Person" fields

    2. Sent a "GET" HTTP Request (Azure DevOps) asking for the revisions

    https://dev.azure.com/organization/project/_apis/wit/workItems/workitem#/revisions?api-version=6.0 

    3. On the last revision the users were identified, and I could take out their Azure DevOps guid ("id")

    4. Sent a "POST" HTTP Request (Azure DevOps) where the body was a variation of what you wrote before and in other posts. I don't exactly understand what the @ person's name is supposed to do because it always uses the Display Name, but if I didn't write anything it didn't work:

    {"text": "<div><a href=\"#\" data-vss-mention=\"version:2.0,guid 1\">@Person 1's name</a>&nbsp; <a href=\"#\" data-vss-mention=\"version:2.0,guid-2\">@Person 2's name</a>&nbsp; Comment</div>"}

     

    I don't know what the formatting conventions are in this forum but for lay people like me, I put what we should change in Arial Black 😊

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard