Skip to content

Create Work Item failed because of type can not be replaced in url #259

Closed
@conhua

Description

@conhua

/_apis/wit/workItems/${type}

When I call create work item, type is not replaced by the parameter

KeyError Traceback (most recent call last)
in
----> 1 work_item_client.create_work_item(document=document, project='Cognitive Services', type='Task')

~\AppData\Local\Continuum\anaconda3\lib\site-packages\azure\devops\released\work_item_tracking\work_item_tracking_client.py in create_work_item(self, document, project, type, validate_only, bypass_rules, suppress_notifications, expand)
1082 query_parameters=query_parameters,
1083 content=content,
-> 1084 media_type='application/json-patch+json')
1085 return self._deserialize('WorkItem', response)
1086

~\AppData\Local\Continuum\anaconda3\lib\site-packages\azure\devops\client.py in _send(self, http_method, location_id, version, route_values, query_parameters, content, media_type, accept_media_type, additional_headers)
75 location_id=location_id,
76 route_values=route_values,
---> 77 query_parameters=query_parameters)
78 negotiated_version = self._negotiate_request_version(
79 self._get_resource_location(location_id),

~\AppData\Local\Continuum\anaconda3\lib\site-packages\azure\devops\client.py in _create_request_message(self, http_method, location_id, route_values, query_parameters)
130 logger.debug('Route template: %s', location.route_template)
131 print(url)
--> 132 request = ClientRequest(method=http_method, url=self._client.format_url(url))
133 if query_parameters:
134 request.format_parameters(query_parameters)

~\AppData\Local\Continuum\anaconda3\lib\site-packages\msrest\service_client.py in format_url(self, url, **kwargs)
149 :param str url: The request URL to be formatted if necessary.
150 """
--> 151 url = url.format(**kwargs)
152 parsed = urlparse(url)
153 if not parsed.scheme or not parsed.netloc:

KeyError: 'type'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions