You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/report/extend-analytics/work-item-links.md
+40-41Lines changed: 40 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,39 @@
1
1
---
2
2
title: Query for Linked Work Items
3
3
titleSuffix: Azure DevOps
4
-
description: Learn how to create a query for linked work items using Analytics for Azure DevOps.
4
+
description: Find out how to create OData queries against Analytics for Azure DevOps to retrieve information about linked work items.
5
5
ms.subservice: azure-devops-analytics
6
6
ms.topic: tutorial
7
7
ms.assetid: BF30FE4E-0370-4C9B-A660-51207D816F8B
8
8
ms.author: chcomley
9
9
author: chcomley
10
10
monikerRange: "<=azure-devops"
11
11
ms.date: 05/09/2025
12
+
# customer intent: As a developer, I want to find out how to create OData queries against Analytics for Azure DevOps so that I can retrieve information about linked work items.
Querying work items across links is much like using typical navigation properties. Links themselves are entities though, so there's some extra complexity.
19
+
When you run Open Data Protocol (OData) queries against Analytics for Azure DevOps, you can retrieve information about work items. You can also query linked work items. Work items can be linked hierarchically, such as in parent or child relationships. Work items can also be linked nonhierarchically, such as when work items are related or are duplicates.
19
20
20
-
There are two ways to query for linked work items. The first is the Parent/Child hierarchy, and the second is the Links navigation property.
21
+
The way you query linked work items is similar to the way you use navigation properties to filter queries of entity sets. But links are entities, so there's some extra complexity. There are two ways to query linked work items:
22
+
23
+
- By using the `Parent` or `Children` navigation properties
24
+
- By using the `Links` navigation property
21
25
22
26
In this tutorial you:
23
27
24
28
> [!div class="checklist"]
25
-
> * Construct a query to return hierarchically (parent-child) linked work items
26
-
> * Construct a query to return non-hierarchically (related, direct) linked work items
29
+
> * Construct queries to return hierarchically linked work items.
30
+
> * Construct queries to return nonhierarchically linked work items.
You can include items related through Parent/Child links by using ```$expand```on the Parent and Children properties.
53
+
You can query items related through parent-child links by using the `$expand` option on the `Parent` and `Children` navigation properties.
50
54
51
-
### Example: Parent to child query
55
+
### Example: Request an item's children
52
56
53
-
To return information about an item's children, use ```$expand``` on the **Children** navigation property.
54
-
The following code snippet requests to return the children of work item ID 359 from the Fabrikam Fiber project.
57
+
To return information about an item's children, use `$expand` on the `Children` navigation property. The following OData code queries the Fabrikam Fiber project in the fabrikam organization. It returns the children of the work item with ID 359.
The response returns feature 480, which is the parent to product backlog item 1048.
111
+
The response lists information about the feature with ID 480, which is the parent of the product backlog item with ID 1048.
109
112
110
113
**Response**
111
114
@@ -131,13 +134,13 @@ The response returns feature 480, which is the parent to product backlog item 10
131
134
}
132
135
```
133
136
134
-
## Query for non-hierarchical links
137
+
## Query for nonhierarchical links
135
138
136
-
In addition to the Parent/Child hierarchy, items can be directly related to other items with link types like *Related* or *Duplicate*. The **Links** navigation property allows you to request these relationships.
139
+
Besides parent-child links, other types like `Related` or `Duplicate` can also link work items. You can use the `Links` navigation property to request information about work items linked through nonhierarchical relationships.
137
140
138
141
### Example: Request an item's links
139
142
140
-
To retrieve the links associated with an item, you can ```$expand```the **Links** navigation property. In this example the **SourceWorkItemId**, **TargetWorkItemId**, and **LinkTypeName** are retrieved for all links associated with the work item 363.
143
+
To retrieve the links associated with an item, you use the `$expand` option on the `Links` navigation property. The following query retrieves the `SourceWorkItemId`, `TargetWorkItemId`, and `LinkTypeName` values for all links associated with work item 363.
### Example: Request detailed information about linked items
186
+
187
+
You can query detailed information about linked work items by using the `$expand` option on the `TargetWorkItem` or `SourceWorkItem` navigation properties.
183
188
184
-
You can include the details of your linked work items by using ```$expand``` on the **TargetWorkItem** or **SourceWorkItem** navigation properties. In this example, we retrieve the **WorkItemId**, **Title**, and **State**of the target work item for each link.
189
+
Like the previous query, the following query retrieves the `SourceWorkItemId`, `TargetWorkItemId`, and `LinkTypeName` values for all links associated with a work item. But this query also retrieves the `WorkItemId`, `Title`, and `State` values of each link's target work item.
You may also be interested in a particular type of link between items. Specify the **LinkTypeName** property in a `$filter` clause. The following query example expands all **Related** links and filters out all other link types for work item 103.
250
+
If you're interested in a particular type of link between items, you can use the `LinkTypeName` property in a `$filter` clause. The following query expands all `Related` links and filters out all other link types for work item 103.
> The Analytics service is automatically enabled and supported in production for all Azure DevOps Services. [Power BI integration](../powerbi/overview.md) and access to the [OData feed](../extend-analytics/quick-ref.md) of the Analytics Service are generally available. We encourage you to use it and give us feedback.
13
-
> Available data is version-dependent. The latest supported version is `v2.0`, and the latest preview version is `v4.0-preview`. For more information, see [OData API versioning](../extend-analytics/odata-api-version.md).
12
+
> The Analytics service is automatically enabled and supported in production for all services within Azure DevOps Services. [Power BI integration](../powerbi/overview.md) and access to the [OData feed](../extend-analytics/quick-ref.md) of the Analytics service are generally available. You're encouraged to use the Analytics OData feed and provide feedback.
13
+
>
14
+
> Available data is version-dependent. The latest supported version of the OData API is `v2.0`, and the latest preview version is `v4.0-preview`. For more information, see [OData API versioning](../extend-analytics/odata-api-version.md).
> The Analytics service is automatically installed and supported in production for all new project collections for Azure DevOps Server 2020 and later versions. [Power BI integration](../powerbi/overview.md) and access to the [OData feed](../extend-analytics/quick-ref.md) of the Analytics Service are generally available. We encourage you to use it and give us feedback. If you upgraded from Azure DevOps Server 2019, then you can install the Analytics service during upgrade.
21
+
> The Analytics service is automatically installed and supported in production for all new project collections for Azure DevOps Server 2020 and later versions. [Power BI integration](../powerbi/overview.md) and access to the [OData feed](../extend-analytics/quick-ref.md) of the Analytics service are generally available. You're encouraged to use the Analytics OData feed and provide feedback. If you upgrade from Azure DevOps Server 2019, you can install the Analytics service during upgrade.
21
22
>
22
-
> Available data is version-dependent. The latest supported version is `v2.0`, and the latest preview version is `v4.0-preview`. For more information, see [OData API versioning](../extend-analytics/odata-api-version.md).
23
+
> Available data is version-dependent. The latest supported version of the OData API is `v2.0`, and the latest preview version is `v4.0-preview`. For more information, see [OData API versioning](../extend-analytics/odata-api-version.md).
Copy file name to clipboardExpand all lines: docs/report/includes/note-work-item-link-warning.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@ ms.technology: devops-analytics
3
3
ms.author: chcomley
4
4
author: chcomley
5
5
ms.topic: include
6
-
ms.date: 10/26/2022
6
+
ms.date: 05/09/2025
7
7
---
8
8
9
9
10
10
> [!NOTE]
11
-
> Most OData queries that request work item link information will return results but also a warning. The warning is a reminder to follow recommended query guidelines described in [OData Analytics query guidelines](../extend-analytics/odata-query-guidelines.md). However, the query examples provided are valid.
11
+
> Most OData queries that request work item link information return results but also a warning. The warning is a reminder to follow the recommended query guidelines described in [OData Analytics query guidelines](../extend-analytics/odata-query-guidelines.md). However, the query examples in this article are valid.
0 commit comments