Created
April 9, 2022 08:10
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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