Trying to get TFS bug State change dates by Reading defect History from TFS ticket using rest api

197 views Asked by At

I am trying to chart out the ticket state change dates to uncover the average time each ticket sits in each of its states (Bug Life cycle). Using rest API's able to get the Create/closed/Resolved dates etc but how can I get the state change dates?

One option that I thought was to read the content from the History Tab (picture attached (History tab) contents right next to Link Tab. Let me know if any of you have already explored it.

I have tried reading the contents using API with fields.System.History but so far it returned null even though there was some contents. am I using the right filed name?

1

There are 1 answers

0
Shayki Abramczyk On

You can achieve it with the revision API (I don't know if it exist in TFS 2015):

GET https://{instance}/{collection}/_apis/wit/workItems/{id}/revisions/?api-version=4.1

You will get all the revisions for the work item, each revision includes State and ChangedDate, so you can investigate it and get the dates when the state changed.