Search code examples
azure-devopsazure-devops-rest-apiazure-devops-extensions

Getting activity field from devops rest api


We have some fields in DevOps, and I would like to get the field called activivty: enter image description here

I use following call:

https://dev.azure.com/xxx/xxx/_apis/wit/workitemsbatch?api-version=5.1&$expand=Fields

I get most of the info on the work item, but not the activity value. Any pointers on how to get this value?


Solution

  • To get the Activity field value of the work item, you can check the filed: Microsoft.VSTS.Common.Activity in the Rest API response.

    Since you are using the Rest API: Work Items - Get Work Items Batch, you can refer to the following sample:

    Rest API:

    Post https://dev.azure.com/orgname/_apis/wit/workitemsbatch?api-version=6.0
    

    Request Body:

    {
      "ids": [
        workitemids
      ],
      
      "fields": [
        "Microsoft.VSTS.Common.Activity"
       
      ]
    
    }
    

    Result:

    enter image description here