STDOUT:
{'rel': 'AttachedFile', 'url': '<uniquely identified link to the file>', 'attributes': {'authorizedDate': '2017-01-09T14:49:32.633Z', 'id': ..., 'resourceCreatedDate': '2017-01-09T14:49:10.473Z', 'resourceModifiedDate': '2017-01-09T14:49:10.473Z', 'revisedDate': '9999-01-01T00:00:00Z', 'resourceSize': 100937, 'name': '<filename>.png'}}
I'm still not sure, but it seems that the ability to work with attached files is already encapsulated.
Another interesting key is workitem._data["_links"], which contains:
{'self': {'href': '<link to the workitem in JSON>'}, 'workItemUpdates': {'href': '...'}, 'workItemRevisions': {'href': '...'}, 'workItemHistory': {'href': '<link to workitem's comments in JSON>'}, 'html': {'...'}, 'workItemType': {'...'}, 'fields': {'href': '...'}}
There's an encapsulated functional that doesn't seem to be in the Public API.
More specifically:
workitem._data
which is a dict()workitem._data["relations"]
)Concrete example: ...
logging.info(workitem._data["relations"][-1])
...STDOUT:
{'rel': 'AttachedFile', 'url': '<uniquely identified link to the file>', 'attributes': {'authorizedDate': '2017-01-09T14:49:32.633Z', 'id': ..., 'resourceCreatedDate': '2017-01-09T14:49:10.473Z', 'resourceModifiedDate': '2017-01-09T14:49:10.473Z', 'revisedDate': '9999-01-01T00:00:00Z', 'resourceSize': 100937, 'name': '<filename>.png'}}
I'm still not sure, but it seems that the ability to work with attached files is already encapsulated.
Another interesting key is
workitem._data["_links"]
, which contains:{'self': {'href': '<link to the workitem in JSON>'}, 'workItemUpdates': {'href': '...'}, 'workItemRevisions': {'href': '...'}, 'workItemHistory': {'href': '<link to workitem's comments in JSON>'}, 'html': {'...'}, 'workItemType': {'...'}, 'fields': {'href': '...'}}