API Documentation¶
Connection¶
TFSAPI¶
-
class
tfs.
TFSAPI
(server_url, project='DefaultCollection', user=None, password=None, pat=None, verify=False, auth_type=<class 'requests.auth.HTTPBasicAuth'>, connect_timeout=20, read_timeout=180)[source]¶ Bases:
object
-
copy_workitem
(workitem, with_links_and_attachments=False, from_another_project=False, target_type=None, target_area=None, target_iteration=None, validate_only=None, bypass_rules=None, suppress_notifications=None, api_version=1.0)[source]¶ Create a copy of a work item
Parameters: - workitem – Source workitem
- with_links_and_attachments – When True, all relations are copied
- from_another_project – When True, certain fields are not copied
- target_type – When specified, the copy will have this type instead of the source one
- target_area – When specified, the copy will have this area instead of the source one
- target_iteration – When specified, the copy will have this iteration instead of the source one
- validate_only – When True, do not actually create a work item, a dry run of sorts
- bypass_rules – When True, can bypass restrictions like <ALLOWEDVALUES> and such
- suppress_notifications – When true, notifications are [supposedly] not sent
- api_version – API version to use
Returns: WorkItem instance of a newly created copy
-
create_workitem
(type_, fields=None, relations_raw=None, validate_only=None, bypass_rules=None, suppress_notifications=None, api_version=1.0)[source]¶ Create work item. Doc: https://docs.microsoft.com/en-us/rest/api/vsts/wit/work%20items/create
Parameters: - type – Work item
- fields – Dictionary containing field values
- relations_raw – List containing relations which are dict(rel, url[, attributes])
- validate_only – When True, do not actually create a work item, a dry run of sorts
- bypass_rules – When True, can bypass restrictions like <ALLOWEDVALUES> and such
- suppress_notifications – When true, notifications are [supposedly] not sent
- api_version – API version to use
Returns: WorkItem instance of a newly created WI
-
Resources¶
TFSObject¶
Workitem¶
-
class
tfs.
Workitem
(data=None, tfs=None, uri='')[source]¶ Bases:
tfs.resources.TFSObject
-
add_relations_raw
(relations_raw, params=None)[source]¶ Add attachments, related (work item) links and/or hyperlinks
Parameters: relations_raw – List of relations. Each relation is a dict with the following keys: rel, url, attributes
-
attachments
¶
-
child_ids
¶
-
childs
¶
-
field_names
¶
-
find_in_relation
(relation_type)[source]¶ Get relation by typename. Auto add
Parameters: relation_type – Returns:
-
history
¶
-
parent
¶
-
parent_id
¶
-
revisions
¶
-