azure-devops-python-api icon indicating copy to clipboard operation
azure-devops-python-api copied to clipboard

'WorkItemTrackingClient' object has no attribute 'get_comments'

Open suchir001 opened this issue 6 years ago • 4 comments

I get this exception when I try to use get_comment or get_comments. I am trying to pull the most recent comment and use it for reporting the correct status. I could see there was another issue reported in June 2019 related to get_comment and get_comments but that was closed as not repro I believe.

suchir001 avatar Apr 23 '20 04:04 suchir001

Hi following up on this, do you know what could be going wrong here?

suchir001 avatar Apr 28 '20 16:04 suchir001

Hi @suchir001 , you are probably using the wrong version of the WorkItemTrackingClient. There are three:

released/work_item_tracking/work_item_tracking_client.py v5_1/work_item_tracking/work_item_tracking_client.py v6_0/work_item_tracking/work_item_tracking_client.py

If you do a search for get_comments, you will see that get_comments only exists on the v5_1 and the v6_0 versions. The released version does not have it. This means that the underlying REST API is still in preview.

Try getting the client like this:

wit_client = connection.clients_v6_0.get_work_item_tracking_client()

tedchamb avatar May 05 '20 15:05 tedchamb

@tedchamb - awesome thanks a lot Ted! This works. sorry i should have looked. What version of the API does the released version of the library support?

suchir001 avatar May 07 '20 00:05 suchir001

@suchir001 , The released clients are 5.1, but they only include those endpoints that have been marked as released. I am not sure for what api version they will mark the comments apis as released.

tedchamb avatar May 07 '20 12:05 tedchamb