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

Cannot call create_work_item in CLI with fields containing "=" sign #243

Closed
jfthuong opened this issue Nov 11, 2018 · 4 comments
Closed
Labels
bug done Code complete - will be released with the next major update to the CLI

Comments

@jfthuong
Copy link

The variable fields for functions create_work_item and update_work_item is a list if strings "<param>=<value>", but is referenced in several places (docstring and error message) as a Space separated "field=value" (see file cli\work\common\work_item.py).

Moreover, the code kvp = field.split("=") prevents using a value with = sign (like in Test Steps that use XML code): it would be better to add a limitation: kvp = field.split("=", 1).

@tedchamb tedchamb transferred this issue from microsoft/azure-devops-python-api Nov 16, 2018
@tedchamb
Copy link
Contributor

The functions create_work_item and update_work_item from cli\work\common\work_item.py are not meant to be called outside the cli. The docstring and error messages are used for display purposes on the command line.

if you want to create or update a work item from a python script, then call the python sdk directly. You can find these methods here:

https://github.com/Microsoft/azure-devops-python-api/blob/51ebc471b13b583b13cf5bc3b891bc2b2573759d/vsts/vsts/work_item_tracking/v4_1/work_item_tracking_client.py#L1216

The second issue you mentioned, regarding the split is a bug. Thanks for reporting it.

@tedchamb tedchamb added the bug label Nov 16, 2018
@atbagga atbagga assigned ishitam8 and unassigned ishitam8 Nov 18, 2018
@jfthuong
Copy link
Author

For the first point, I understand now: you use docstrings for generating documentation on usage of CLI.

It is funny that you redirect me to the SDK because I came upon this lines of code in the CLI while I was trying to figure out how to use the functions in work_item_tracking_client.py 😄

@jfthuong jfthuong changed the title Discrepancy in docstring of create_work_item of CLI Implementation of create_work_item of CLI cannot support fields strings containing = sign Nov 19, 2018
@jfthuong jfthuong changed the title Implementation of create_work_item of CLI cannot support fields strings containing = sign Cannot call create_work_item in CLI with fields containing "=" sign Nov 19, 2018
@ishitam8
Copy link
Member

Fields value can now have '=' as well. Thanks @jfthuong for reporting this. You should be able to see the changes in next release.

@ishitam8 ishitam8 added the done Code complete - will be released with the next major update to the CLI label Nov 22, 2018
@atbagga
Copy link
Collaborator

atbagga commented Nov 29, 2018

Fixed in version 0.1.4.

@atbagga atbagga closed this as completed Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done Code complete - will be released with the next major update to the CLI
Projects
None yet
Development

No branches or pull requests

4 participants