I don't exactly know how to fetch the change history and discussion details in VSTS. I have looked into Workitems and Work Item Revisions but didn't get any data related to history or discussion from it.
PFB the format of odata url used -
https://analytics.dev.azure.com/{OrganizationName}/{ProjectName}/_odata/{version}//WorkItemRevisions?
$filter=WorkItemId eq {Id}
&$select=WorkItemId, Title, State
https://analytics.dev.azure.com/{OrganizationName}/{ProjectName}/_odata/{version}//WorkItems?
$filter=WorkItemId eq {Id}
&$select=WorkItemId, Title, State
Based on my test we can only get the change history using the odata, but cannot get discussion history:
For example:
https://analytics.dev.azure.com/{OrganizationName}/{ProjectName}/_odata/v1.0/WorkItemRevisions?$filter=WorkItemId eq 109&$select=WorkItemId, Title, State,Revision,RevisedDate,Reason,StateChangeDate
{
"@odata.context": "https://analytics.dev.azure.com/{OrganizationName}/{ProjectName}/_odata/v1.0/$metadata#WorkItemRevisions(WorkItemId,Title,State,Revision,RevisedDate,Reason,StateChangeDate)",
"value": [
{
"WorkItemId": 109,
"Title": "0329Task2",
"State": "To Do",
"Revision": 7,
"RevisedDate": "2018-07-09T14:02:01.473Z",
"Reason": "New task",
"StateChangeDate": "2018-03-29T02:29:36.91Z"
},
...
...
...
...
To get the Discussion history you can use the REST API (Revisions - List):
GET https://dev.azure.com/{organization}/_apis/wit/workItems/{id}/revisions?api-version=4.1
Or Get a list of all discussion history:
GET https://dev.azure.com/{organization}/_apis/wit/workItems/109/history