azure-devops-cli-extension
azure-devops-cli-extension copied to clipboard
JMESPath Cannot query values containing a dot in the key
This is autogenerated. Please review and update as needed.
Describe the bug
Trying to query specific values from a work-item using the az boards cli with the --query
parameter fails as some of the keys in the JSON payload contains a dot in them.
The following parameter is expected to return the title of a work item:
--query "fields.`"System.Title`""
Sample payload without the --query
{
"fields": {
...
"System.Description": "<div>Sample Description</div>",
"System.Id": 1234,
"System.Title": "Sample Title"
...
},
...
}
Command Name
az boards work-item show Extension Name: azure-devops. Version: 0.21.0.
To Reproduce:
Command used (id and organization has been removed)
az boards work-item show `
--id {} `
--organization {} `
--query "fields.`"System.Title`""
Expected Behavior
The title of the task returned in the terminal output.
Environment Summary
Windows-10-10.0.18362-SP0
Python 3.8.9
Installer: MSI
azure-cli 2.26.1 *
Extensions:
azure-devops 0.21.0
Additional Context
Seconded, this is blocking me from checking if an ACR Task credentials exists as I can't query the result object.
Try: 'fields."System.Title"'
Escaping the quotes as suggested in here works for me
--query 'fields.\"System.Title\"'