Skip to content

Fix Azure DevOps work item URLs to point to human-facing UI instead of REST API - #23

Merged
richardthombs merged 2 commits into
mainfrom
copilot/fix-work-item-urls
Mar 19, 2026
Merged

richardthombs merged 2 commits into
mainfrom
copilot/fix-work-item-urls

Conversation

Copilot AI commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Work item URLs in RelatedIssue.URL were set directly from the url field returned by the Azure DevOps API, which always uses the _apis/wit/workItems/{id} path rather than the browsable _workitems/edit/{id} path.

Changes

  • buildAzureIssueList: replaced direct use of item.URL with a new azureWorkItemWebURL helper
  • azureWorkItemWebURL: strips the /_apis/… suffix from the API URL and reconstructs as /_workitems/edit/{id}. Handles the org-scoped case (no project in path) by appending System.TeamProject — e.g. https://dev.azure.com/ensekltd/_apis/wit/workItems/378982 + project blackbird → https://dev.azure.com/ensekltd/blackbird/_workitems/edit/378982
Before: https://dev.azure.com/org/project/_apis/wit/workItems/1001
After:  https://dev.azure.com/org/project/_workitems/edit/1001

Applies to both the CLI (az boards work-item show) and REST code paths, as both flow through buildAzureIssueList. Also covers visualstudio.com-hosted organisations.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/acme/repo/pulls/42
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build990954897/b187/importcfg -pack /home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/vendor/golang.org/x/net/http/httpguts/guts.go 0.1-�� 0.1-go1.25.0.linux-amd64/src/run--gdwarf-5 r ux-amd64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build990954897/b130/importcfg -pack /home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/crypto/tls/alert.go (http block)
  • https://api.github.com/repos/acme/repo/pulls/73
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build990954897/b195/importcfg -pack /home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/net/textproto/header.go (http block)
  • https://api.github.com/repos/acme/repo/pulls/77
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha (http block)
  • https://api.github.com/repos/checkouttestuser/checkouttestrepo/pulls/987654321
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha /tmp/go-build990954897/b179/_x001.o /tmp/go-build990954897/b179/_x002.o /tmp/go-build990954897/b179/_x003.o /tmp/go-build990954897/b179/_x004.o /tmp/go-build990954897/b179/_x005.o /tmp/go-build990954897/b179/_x006.o -O2 (http block)
  • https://api.github.com/repos/checkouttestuser2/checkouttestrepo2/pulls/123456789
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Azure DevOps Work Item URL points to the the REST API url and not the main website URL</issue_title>
<issue_description># Problem statement
Azure DevOps work-item links are pointing to the REST API path to the item:
https://dev.azure.com/ensekltd/_apis/wit/workItems/378982

Requirements

The work item should link to the human-facing website:
https://dev.azure.com/ensekltd/blackbird/_workitems/edit/378982</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…T API URL

Co-authored-by: richardthombs <1511599+richardthombs@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Azure DevOps Work Item URLs to point to main website Fix Azure DevOps work item URLs to point to human-facing UI instead of REST API Mar 19, 2026
Copilot AI requested a review from richardthombs March 19, 2026 14:11
@richardthombs
richardthombs marked this pull request as ready for review March 19, 2026 14:34
@richardthombs
richardthombs merged commit 0f9ce9c into main Mar 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure DevOps Work Item URL points to the the REST API url and not the main website URL

2 participants