Skip to content

Sample code for create work item #226

@corbyjames

Description

@corbyjames

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions