根据用户名/别名作为用户获取用户的详细信息,作为azure devops中的参数 [英] Getting user/users details based on user name/alias as parameter in azure devops

查看:80
本文介绍了根据用户名/别名作为用户获取用户的详细信息,作为azure devops中的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工具(网络应用程序),可以在天蓝色的devops中创建工作项.(跳过不必要的详细信息),就像我们从azure devops中的分配给"下拉列表中为任何用户分配特定工作项的方式一样,我也有一个下拉列表,当用户输入任何名称/别名时,将根据以下内容开始显示用户列表输入.我在后端使用的api是 https://abcorganization.vsaex.visualstudio.com/_apis/UserEntitlements?top = 10& filter = name + eq +%27Tejas

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

在此查询参数中的 filter = name + eq +%27Tejas 有助于查询api,并用于提供名称以Tejas开头的用户集.也可以是电子邮件别名.但是由于某种原因,这不再起作用了.我的猜测是,他们已弃用该API版本

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

因此,在寻找替代方案/答案的搜索中,我遇到了以下文档:( https://docs.microsoft.com/zh-cn/rest/api/azure/devops/graph/users/get?view=azure-devops-rest-5.1 ),其中给出的API为: https://vssps.dev.azure.com/abcorganization/_apis/graph/users/{userDescriptor}?api-version = 5.1-preview.1

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

在这里,userDescriptor是与特定用户相关的某种AAD唯一密钥.(我当然不能用来实现我的目的).

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

我尝试过的另一件事是下面的查询参数,但仍然没有解决 https://vssps.dev.azure.com/abcorganization/_apis/graph/users?subjectTypes= {subjectTypes}& continuationToken = {continuationToken}& api-version = 5.1-preview.1

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

因此,无论如何/api是否可以实现我的目的,或者是我以错误的方式或某种方式使用了这个新的API?任何帮助将不胜感激

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

推荐答案

我相信它应该在查询中为 $ filter .您还缺少结束语.

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'

这篇关于根据用户名/别名作为用户获取用户的详细信息,作为azure devops中的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆