Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'TFSAPI' object has no attribute 'create_workitem' #83

Open
zsmjluo opened this issue Dec 23, 2019 · 3 comments
Open

'TFSAPI' object has no attribute 'create_workitem' #83

zsmjluo opened this issue Dec 23, 2019 · 3 comments
Assignees
Labels

Comments

@zsmjluo
Copy link

zsmjluo commented Dec 23, 2019

https://devopshq.github.io/tfs/examples.html#create-or-copy-workitem

create_workitem return error

@Tim55667757
Copy link
Member

@zsmjluo Can you attach a complete trackback? What type of error? And how did you create a connection with TFS before that?

@zsmjluo
Copy link
Author

zsmjluo commented Dec 23, 2019

@Tim55667757
reinstall doha-tfs:pip install dohq-tfs, create_workitem is ok. bug update workitem is wrong.
Before reinstall doha-tfs,update workitem is ok.

workitem["State"] = "finish"
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tfs\resources.py", line 229, in setitem
raw = self.tfs.update_workitem(self.id, update_data)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tfs\connection.py", line 224, in update_workitem
payload=params)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tfs\connection.py", line 462, in send_patch
return self.__send_request('PATCH', uri, data, headers, payload=payload, underProject=project)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tfs\connection.py", line 506, in __send_request
response.raise_for_status()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:8080/tfs/test/_apis/wit/workitems/18477?api-version=1.0&api-version=1.0

@SAnCherepan
Copy link
Contributor

@zsmjluo, I was able to reproduce your error with update_workitem only with incorrect state (e.g. Completed instead of Complete.

Make sure you use the latest version (1.0.79 at the moment of writing) and specify correct state.

Let us know if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants