Forum Discussion

surendra-p's avatar
surendra-p
Copper Contributor
Dec 06, 2024
Solved

azure board How get the work item parent work item id

I am using  work item details api _apis/wit/workItems/{workItemId}?api-version=7.1 my requirement is to get the parent id of the work item as per my investigation it says we have to check the relati...
  • Verde1234's avatar
    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

    Work Items - Get Work Item - REST API (Azure DevOps Work Item Tracking) | Microsoft Learn

Resources