2

I've a tool(web application) which creates work-items in azure devops. (skipping the unnecessary details), just like how we assign any user a particular work-item from the Assigned To dropdown in azure devops, I too have a dropdown which when user enters any name/alias, a list of users starts showing based on the input. The api which I was using in the backend was https://abcorganization.vsaex.visualstudio.com/_apis/UserEntitlements?top=10&filter=name+eq+%27Tejas

Here filter=name+eq+%27Tejas in the query parameter helps to query the api and used to give set of users whose name starts with Tejas. It can be email alias too. But for some reason, that doesn't work anymore. My guess, they've deprecated that API version

So in my search to find the alternative/answer, I came across the following documentation: (https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/users/get?view=azure-devops-rest-5.1) in which the API given is: https://vssps.dev.azure.com/abcorganization/_apis/graph/users/{userDescriptor}?api-version=5.1-preview.1

Here the userDescriptor is some sort of unique key of AAD related to a particular user. (which I certainly can't use to fulfill my purpose).

The other thing which I've tried is the below query parameters but it still didn't worked out https://vssps.dev.azure.com/abcorganization/_apis/graph/users?subjectTypes={subjectTypes}&continuationToken={continuationToken}&api-version=5.1-preview.1

So is there anyway/api which can fullfil my purpose or is it that I'm using this new API in a wrong way or something? Any help would be much appreciated

13
  • It still works for me. what do you mean "doesn't work anymore", do you get results without filtering? Commented Sep 26, 2019 at 6:02
  • Wired... on my side it returns a filtering results. can you try vsaex.dev.azure.com/organization instead if visualstudio.com...? Commented Sep 26, 2019 at 6:08
  • yes @ShaykiAbramczyk, I did tried that, still returns count zero. No exceptions raised Commented Sep 26, 2019 at 6:13
  • Maybe try to add &api-version=5.0-preview.2 Commented Sep 26, 2019 at 6:16
  • 1
    There are many ways in which this can still "work". For instance you can use IdentityHttpClient class which allows you to query/search for users using their email id or name against Azure DevOPS. The point though is that none of them seem to be supported anymore. Almost all of them are undocumented/unofficial workarounds or solutions on which MS has categorically stated that they are not supported. I am looking for the proper officially recommended way of doing it. Commented Oct 4, 2019 at 13:13

2 Answers 2

1

I believe it should be $filter in the query. You are also missing the closing quote.

(See docs for more details)

https://abcorganization.vsaex.visualstudio.com/_apis/UserEntitlements?top=10&$filter=name+eq+'Tejas'

Sign up to request clarification or add additional context in comments.

2 Comments

$filter or &filter?
@Victor &$filter in other words - both :)
1

Use this. I tested it and worked for me: https://vsaex.dev.azure.com/{organization}/_apis/userentitlements?$filter=name+eq+%27{name}%27&api-version=6.0-preview.3

Replace {organization} and {name} as needed

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.