Forum Discussion
azure board How get the work item parent work item id
- Dec 11, 2024
If you're not seeing the relations field in your response, check if the work item has the correct parent link set in the Azure DevOps UI plus your API request includes the $expand=relations parameter.
So modify api request to include the $expand parameter with the value relations:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{workItemId}?$expand=relations&api-version=7.1
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/get-work-item?view=azure-devops-rest-7.1&tabs=HTTP
If you're not seeing the relations field in your response, check if the work item has the correct parent link set in the Azure DevOps UI plus your API request includes the $expand=relations parameter.
So modify api request to include the $expand parameter with the value relations:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{workItemId}?$expand=relations&api-version=7.1
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/get-work-item?view=azure-devops-rest-7.1&tabs=HTTP