WIQL query to get all the team and the users in a Project?

前端 未结 2 2013
醉梦人生
醉梦人生 2021-01-29 08:00

let\'s say i have a project name =\"Scrum\" and that has some users the project and got sprints so **i want dstinct users of the Project that the Sprints in Scrum **. image atta

2条回答
  •  猫巷女王i
    2021-01-29 08:47

    According to your description, seems you want to get all teams (include all users in the team) and corresponding sprint for each team.

    It's not able to do this through WIQL. WIQL is a work item query language which used to query for bugs, tasks, other types of work items. The return value should be work item.

    Instead, you could use Rest API to achieve your requirement.

    1.First, Get a list of teams in a project.

    GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1/teams?api-version=2.2
    

    2.Get a team's members

    GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1/teams/564e8204-a90b-4432-883b-d4363c6125ca/members/?api-version=2.2
    

    3.Get a team's iterations

    GET https://{instance}/DefaultCollection/{project}/{team}/_apis/work/TeamSettings/Iterations?[$timeframe=current&]api-version={version}
    

    Combine with the above Rest APIs, you could be able to achieve this get teams name with there Sprints in Scrum project and all users of the team.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题