'Get "Mail" Property of User from Azure Devops API Work Item in Single API Call
I'm attempting to get the "Mail" property of related profile fields with a single API call from Azure Devops when pulling a work item.
API Call 1:
GET https://dev.azure.com/my-account/my-project/_apis/wit/workitems?ids=1234&$expand=all
...
"System.CreatedBy": {
"displayName": "John Doe",
"url": "https://spsprodcus1.vssps.visualstudio.com/the-id/_apis/Identities/entity1234",
"_links": {
"avatar": {
"href": "https://dev.azure.com/..."
}
},
"id": "1234...",
"uniqueName": "[email protected]",
"imageUrl": "https://dev.azure.com/...",
"descriptor": "aad...."
},
...
What i'm trying to find is the Mail attribute which you can obtain from the "url" field of the returned results of the first call:
API Call 2:
GET https://spsprodcus1.vssps.visualstudio.com/the-id/_apis/Identities/entity1234
...
{
...
"Properties": {
...
"DN": "",
"Mail": "[email protected]", # <--- THIS IS WHAT I WANT
"SpecialType": "Generic",
...
}
}
...
Is it possible to get both the work item information and the "Mail" attribute of related fields such as "CreatedBy" in API Call 1?
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
