Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MahdiKarimipour/a0f61dae6d5d18ee2a7ee5869855a5b9 to your computer and use it in GitHub Desktop.
Save MahdiKarimipour/a0f61dae6d5d18ee2a7ee5869855a5b9 to your computer and use it in GitHub Desktop.
Get the List of All Project Groups using Azure DevOps APIs and Pellerex
var url = appSettings.AzureDevOpsSettings.GetProjectGroupsUrl
.Replace("{organisation}", organisation)
.Replace("{scopeDescriptor}", projectDescriptor);
var (result, response) = await apiCall.GetAsync<AzureDevOpsGetProjectGroupsResponseDto>(
url: url,
password: appSecrets.AzureDevOpsToken);
if (result.IsEmpty())
{
return new List<GroupViewModel>();
}
var groups = result.value?.Select(g => new GroupViewModel()
{
DisplayName = g.displayName,
PrincipalName = g.principalName,
Descriptor = g.descriptor,
Origin = g.origin,
OriginId = g.originId
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment