2
votes

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://docs.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

2
It still works for me. what do you mean "doesn't work anymore", do you get results without filtering? - Shayki Abramczyk
Wired... on my side it returns a filtering results. can you try vsaex.dev.azure.com/organization instead if visualstudio.com...? - Shayki Abramczyk
yes @ShaykiAbramczyk, I did tried that, still returns count zero. No exceptions raised - TejasGondalia
Maybe try to add &api-version=5.0-preview.2 - Shayki Abramczyk
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. - Nikhil

2 Answers

1
votes

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'