Raul
Raul

Reputation: 685

Getting Work Items in Azure DevOps with the Team responsible

I would like to get a list of work items in Azure DevOps Services with a column displaying the team responsible for every work item. This seems to be impossible!! I don't mind to use any technology available (REST, OData, Queries, ...) but I cannot find any way of doing it.

The work items have an Area Path and they are assigned to Teams, so in SQL it would be like a simple join between the tables, but not so with the Azure DevOps queries.

Any ideas?

Upvotes: 1

Views: 174

Answers (2)

Bright Ran-MSFT
Bright Ran-MSFT

Reputation: 13479

You can use the OData query like as below:

Before you use this OData query, ensure you are the member of Project Administrators group so that you can access and manage teams in the Azure DevOps project.  

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=({some filters})

For example, below sample is to list work items assigned to a specified area path and show the names of teams that the work items belong to.

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 'PrimaryProj\Admin')

Result:

enter image description here

If the area path has been assigned to multiple teams, it will list all the teams which the area path is assigned to.

enter image description here


Upvotes: 3

Shamrai Aleksander
Shamrai Aleksander

Reputation: 16008

It may be available through process customization and work item rules.

  1. Add a new field for a team value: Add and manage fields
  2. Then add a rule to calculate your team through Area ID:

enter image description here

  1. Area ID you may find in query results:

enter image description here

Upvotes: 0

Related Questions