Skip to content

Unable to create work items #77

@harsheel87

Description

@harsheel87

I am using Azure DevOps Server 17.143.28912.1.

I am able to invoke get_workitem calls but create_workitem calls fail. Can someone point me what I may be doing wrong?

staging_client =  TFSAPI("https://staged-tfs.lan/tfs/", pat = 'pat')

fields = {'Title': 'test item: placeholder for new bug', 'Description': 'My description', 'AreaPath': 'Dev\\Data\\Server One', 'IterationPath': 'Dev\\Data Server', 'AssignedTo': 'TFSUnassigned <TSI\\_TFSUnassigned>'}

workitem = staging_client.create_workitem('DEFECT', fields=fields, api_version=5.0)

ERROR:

  ..
  File "E:\automateDashboard\proj1\venv\lib\site-packages\tfs\connection.py", line 309, in create_workitem
    api_version)
  File "E:\automateDashboard\proj1\venv\lib\site-packages\tfs\connection.py", line 282, in __create_workitem
    raw = self.rest_client.send_post(uri=uri, data=data, headers=headers, project=True, payload=params)
  File "E:\automateDashboard\proj1\venv\lib\site-packages\tfs\connection.py", line 456, in send_post
    return self.__send_request('POST', uri, data, headers, payload=payload, underProject=project)
  File "E:\automateDashboard\proj1\venv\lib\site-packages\tfs\connection.py", line 506, in __send_request
    response.raise_for_status()
  File "E:\automateDashboard\proj1\venv\lib\site-packages\requests\models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://staged-tfs.lan/tfs/DefaultCollection/_apis/wit/workitems/$DEFECT?api-version=5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedwaiting for feedbackFeedback from reporter is required. Issue will be closed otherwise.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions