1

Is it possible to query the _odata end point for work items and get the actual team id that the work items are assigned to? I can expand the Teams navigation property but that just gives me a list of all project teams, not the team that the work item belongs to

https://analytics.dev.azure.com/{organization_name}/_odata/v3.0-preview/WorkItems?select=WorkItemId,Title,WorkItemType
Matthew The Terrible
  • 1,589
  • 5
  • 31
  • 53
  • 1
    Hi @Matthew The Terrible, How are things going? Have you tried like as the example I shared in the answer? Is it helpful to you? Please try it, and any progress, feel free to tell me. – Bright Ran-MSFT Dec 22 '20 at 08:37

1 Answers1

3

I can expand the Teams navigation property but that just gives me a list of all project teams, not the team that the work item belongs to

What is the full URL of the OData you are using?

The OData URL you shared seems is not the full.

https://analytics.dev.azure.com/{organization_name}/_odata/v3.0-preview/WorkItems?select=WorkItemId,Title,WorkItemType

I also try expand the teams in the query and it can correctly display the teams which the work items are owned by.

The following is the full URL of the OData I test on Postman:

https://analytics.dev.azure.com/{OrganizationName}/{ProjectName}/_odata/v3.0-preview/WorkItems?$select=WorkItemId, WorkItemType, Title, State, TagNames&$expand=AssignedTo($select=UserEmail), Area($select=AreaPath), Iteration($select=IterationPath), Teams($select=TeamName)&$filter=(Area/AreaPath eq '{AreaPath}')

Result: enter image description here

If the area path of the work item has been assigned to multiple teams, in the Teams object, it will list all the teams which the area path is assigned to. enter image description here

Bright Ran-MSFT
  • 5,190
  • 1
  • 5
  • 12