Closed corbyjames closed 5 years ago
Looking at some C# code examples, it looks like JsonPatchDocument is missing from the work_item_tracking models. Have you tested the create work item method?
It looks like the C# library at least, creates a JsonPatchDocument and then adds JsonPatchOperations to it, thus making it iteratable. If I'm missing something, let me know. The method to create a work item above fails in the recursive _validate method of the serialization file.
Here is some example code from the azure-devops-cli-extension:
Thanks Ted! It makes sense that the document is just a list of operations.
Hi can someone post a code snippet for work item creation? When I do the following, I get an error on the JsonPatchObject.
op = WorkItemFieldOperation(name='add') jsonPatch = JsonPatchOperation(from_=None,op=op,path="/fields/System.Title",value="Test") tWorkItem = work_tracker_client.create_work_item(document=jsonPatch,project="BlueKC_Test",type='Epic',validate_only=None, bypass_rules=None, suppress_notifications=None,expand=None)
get this error:
TypeError: 'JsonPatchOperation' object is not iterable
Thanks!