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