tfs icon indicating copy to clipboard operation
tfs copied to clipboard

Creating work item with validateOnly=True causes exception

Open SAnCherepan opened this issue 7 years ago • 2 comments

validateOnly=true is used to test work item creation without actually creating one. Therefore, response contains fields of not-created-workitem. Logically, it does not contain System.ID. That breaks WorkItem.__init__() method that tries to self.id = self.data["id"] while data has no "id".

SAnCherepan avatar May 16 '18 11:05 SAnCherepan

@allburov , @SAnCherepan : what would be the expected behaviour when calling, e.g. create_workitem('Bug', validateOnly=true)?

A solution could be that create_workitem() would return True/False (depending on http response) instead of returning a Workitem instance. What do you think?

ondrno avatar Dec 30 '18 21:12 ondrno

Maybe fixed with 39aa21686e7ea0fec25d3de560078f51ddeb123d

Boltyk avatar Apr 12 '19 23:04 Boltyk