devopshq / tfs

Microsoft TFS API Python client
https://devopshq.github.io/tfs/
MIT License
110 stars 28 forks source link

Trying to get WI changelog (WI history) #85

Closed LeRobert closed 4 years ago

LeRobert commented 4 years ago

I am trying to retrieve and parse the WI changelog but the following does not work:

workitem.history returns [<tfs.resources.UnknownTfsObject object at 0x000001F48D7F83C8>], while workitem["System.History"] returns None. The changelog of this WI is quite long.

workitem.revisions return a list of <tfs.resources.UnknownTfsObject object at ...

I tried also with workitem.history.data and workitem.revisions.data as I found it under examples but the response is: 'list' object has no attribute 'data'

Using Azure DevOps Server 2019 and dohq-tfs 1.0.175

Is there any other, proper way to get the changelog?

SAnCherepan commented 4 years ago

@LeRobert, afaik. every item in history and revisions has its own data and fields. Try the code below and see if it helps:

for revision in workitem.revisions:
    print(revision.data)
LeRobert commented 4 years ago

Indeed, this works, thank you, JSON data are retrieved now. I was trying according to samples at https://devopshq.github.io/tfs/advanced.html, it would be useful to update them.