question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az devops invoke does not resolve the route correctly in some cases - ends up hitting the wrong endpoint

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az devops invoke Extension Name: azure-devops. Version: 0.15.0.

Errors:

'type'
Traceback (most recent call last):
pip-install-6e754znd\knack\knack\cli.py, ln 206, in invoke
cli\core\commands\__init__.py, ln 603, in execute
cli\core\commands\__init__.py, ln 661, in _run_jobs_serially
cli\core\commands\__init__.py, ln 652, in _run_job
azext_devops\dev\common\exception_handler.py, ln 31, in azure_devops_exception_handler
    reraise(*sys.exc_info())
Temp\pip-install-6e754znd\six\six.py, ln 693, in reraise
cli\core\commands\__init__.py, ln 631, in _run_job
...
azure-devops\azext_devops\devops_sdk\client.py, ln 63, in _send
    query_parameters=query_parameters)
azure-devops\azext_devops\devops_sdk\client.py, ln 116, in _create_request_message
    url = self._client.format_url(route_template, **route_values)
pip-install-6e754znd\msrest\msrest\service_client.py, ln 151, in format_url
KeyError: 'type'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az devops invoke --area wit --resource workitems --route-parameters project=<project_name> id=<workitem_id>

replace <project_name> and <workitem_id> with valid values for a project in Azure DevOps and a workitem id

Expected Behavior

Return workitem details. Should work like the rest api: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work items/get work item?view=azure-devops-rest-5.1#workitemexpand

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6
Shell: powershell.exe

azure-cli 2.0.74 *

Extensions:
azure-devops 0.15.0

Additional Context

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
asmundgcommented, Feb 12, 2021

It looks like the underlying issue is that there are two resources called ‘workItems’, and invoke unconditionally picks the second:

  {
    "area": "wit",
    "id": "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b",
    "maxVersion": 6.1,
    "minVersion": 1.0,
    "releasedVersion": "6.0",
    "resourceName": "workItems",
    "resourceVersion": 3,
    "routeTemplate": "{project}/_apis/{area}/{resource}/{id}"
  },

  {
    "area": "wit",
    "id": "62d3d110-0047-428c-ad3c-4fe872c91c74",
    "maxVersion": 6.1,
    "minVersion": 1.0,
    "releasedVersion": "6.0",
    "resourceName": "workItems",
    "resourceVersion": 3,
    "routeTemplate": "{project}/_apis/{area}/{resource}/${type}"
  },
1reaction
carlos-ricciardicommented, Nov 22, 2019

Thank you for the reply!

I know about this command. The problem is that this command doesn’t return the _links property and the rest api call does, If you could include this property in the return from az boards work-item show command would be even better 😃

Thanks a lot for the support, Carlos.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot pipeline runs - Azure DevOps - Microsoft Learn
You can use the following troubleshooting sections to help diagnose issues with your pipeline. Most pipeline failures fall into one of these categories....
Read more >
az devops cli like a boss | Colin's ALM Corner
However, while having a REST API is great, interacting with a service ... In this post, I examine the az devops cli using...
Read more >
Fix list for IBM WebSphere Application Server V8.5
The following is a complete listing of fixes for V8.5 with the most recent fix ... PI65490, Incorrect status of the job when...
Read more >
The requested resource does not support HTTP method 'GET'
Resolved this issue by using http(s) when accessing the endpoint. The route I was accessing was not available over http .
Read more >
Known Issues for Oracle SOA Products 12.1.3
Java DB client driver derbyclient.jar, is not included with JES. ... When SOA composite 1 is invoked, Oracle Service Bus returns a fault...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found