Forum Discussion
chamidu_sumanasekara
Nov 28, 2024Copper Contributor
How to Retrieve Work item updates history
How to Retrieve Work item updates history for a specific field like remaining Work using Azure DevOps API adding extra details in comment section
Kidd_Ip
Nov 30, 2024MVP
Try this:
- API Endpoint: Use the following endpoint to get the updates for a specific work item.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{workItemId}/updates?api-version=7.1Replace {organization}, {project}, and {workItemId} with your specific values.
- Filtering Updates: The response will include a list of all updates made to the work item. You'll need to manually filter for changes to the "Remaining Work" field by iterating through the field property of each update.
- Example Response: Here's a simplified example of what the response might look like:
{
"updates": [
{
"id": 1,
"updatedBy": "email address removed for privacy reasons",
"updatedDate": "2024-11-30T12:34:56Z",
"fields": {
"Microsoft.VSTS.Scheduling.RemainingWork": 120
}
},
{
"id": 2,
"updatedBy": "email address removed for privacy reasons",
"updatedDate": "2024-11-29T11:22:33Z",
"fields": {
"Microsoft.VSTS.Scheduling.RemainingWork": 150
}
}
]
}
- Filtering in API Call: Unfortunately, there isn't a direct way to filter the results in the API call to retrieve updates only for the "Remaining Work" field. You'll need to process the response in your application to extract the relevant updates.