Azure Boards
The azure-boards tracker reads work items from Azure DevOps Services (dev.azure.com) and from Azure DevOps Server: fields, comments, attachments, links, update history and search, including raw WIQL. It is read-only. This page covers the profile entry, how the project allow-list works, which references it accepts and what is unverified.
Profile entry
- id: boards
type: azure-boards
organization: acme
projects: [Platform]
token_env: AZURE_DEVOPS_PATA work item is named by its number. Three forms reach it:
safran ticket 1423
safran ticket AB#1423
safran ticket https://dev.azure.com/acme/Platform/_workitems/edit/1423import { createSafran } from "@safran/core";
await using safran = await createSafran({ profile: "safran.yaml" });
const item = await safran.tickets.get("AB#1423");
console.log(item.key, item.type, item.status, item.fields["Story points"]);
const history = await safran.tickets.history("boards:1423", { limit: 20 });
for (const entry of history.items) console.log(entry.at, entry.field, entry.from, "→", entry.to);Authentication
token_env names a variable holding a personal access token with the Work Items (Read) scope. It is sent as HTTP Basic with an empty user name, on every request, together with a header that asks Azure DevOps for a 401 instead of a redirect to its sign-in page.
An invalid or expired token is often not answered with 401: Azure DevOps sends HTTP 203, or 200, with an HTML sign-in page. The connector treats any 203, any HTML answer and any redirect that leads to a sign-in address as AUTH_FAILED, with a hint naming the variable. Redirects are never followed with the token attached.
Azure DevOps Server
- id: boards
type: azure-boards
url: https://tfs.acme.test/tfs
organization: DefaultCollection
project: Platform
token_env: AZURE_DEVOPS_PAT
api_version: "6.0"url is the server root in front of the collection, and organization is the collection name. Requests go to <url>/<organization>/…. Older servers need a lower api_version.
The connection fields (organization, url, project / projects, api_version) have the same names and meaning as in the azure-repos code host, so one organization is described the same way in both entries.
Configuration reference
| Field | Type | Default | Required | Meaning |
|---|---|---|---|---|
id | string | yes | Name of this entry. | |
type | "azure-boards" | yes | Selects this plugin. | |
organization | string | yes | Organization on dev.azure.com, or the collection name on Azure DevOps Server. A name, not a path or URL. | |
url | URL | https://dev.azure.com | no | Azure DevOps Server only: the server root in front of the collection. |
project | string | no | Shorthand for a single entry in projects. | |
projects | string[] | [] | no | Project names this tracker owns. When the list is not empty, work items of other projects are refused. |
token_env | variable name | yes | Variable holding a personal access token with Work Items (Read) scope. | |
api_version | string | "7.1" | no | REST API version, like "7.1" or "7.1-preview.3". Quote it in YAML. |
custom_fields | string[] | [] | no | Field reference names (e.g. Custom.RiskLevel) copied into Ticket.fields. |
project and projects are merged. Project names are compared case-insensitively.
The project allow-list
When project or projects is set, the list is a boundary, not a filter on search only:
- Reading a work item, its comments, attachments, links or history checks the project the work item is really in, from the response, and fails with
FORBIDDENwhen that project is not listed. The hint names the profile field to change. listProjectsreturns only the listed projects.- A neutral search is restricted to them.
- A URL that names another project is not recognised as a reference.
With an empty list, every project the token can see is readable.
Ticket references
The canonical key is the bare id, 1423.
| Input | Result |
|---|---|
1423 | 1423 |
AB#1423, ab#1423 | 1423 |
001423 | 1423 |
#1423 | not matched |
0, or a number above 2147483647 | not matched |
https://dev.azure.com/acme/Platform/_workitems/edit/1423 | 1423 |
https://dev.azure.com/acme/_workitems/edit/1423 (no project) | 1423 |
https://dev.azure.com/acme/Other/_workitems/edit/1423 with projects: [Platform] | not matched |
https://acme.visualstudio.com/Platform/_workitems/edit/1423 | 1423 |
REST …/_apis/wit/workItems/1423 | 1423 |
Board, backlog, sprint or query URL with ?workitem=1423 | 1423 |
| Any of these on another host or organization | not matched |
AB#1423is the form Azure Boards documents for mentions from commits and pull requests.#1423is deliberately not matched: it is GitHub's issue syntax, and matching it here made a profile with both trackers ambiguous. No other built-in tracker claims a bare number orAB#, so these two forms never collide.- The legacy host
<organization>.visualstudio.comis accepted only whenurlis the defaulthttps://dev.azure.com. - Naming the tracker does not change what is matched:
boards:1423andboards:AB#1423resolve,boards:#1423does not. Only the tracker object's own methods accept#1423(safran.trackers.get("boards")?.getTicket("#1423")), because there the tracker is already chosen.
A bare number is the one form no other built-in tracker accepts, so Azure Boards can share a profile with Jira, Linear and GitHub Issues without projects lists.
What a ticket contains
Ticket field | Source in Azure Boards |
|---|---|
key | The work item id |
title, type, status | System.Title, System.WorkItemType, System.State |
statusCategory | The state's category in the project's process: Proposed → todo; InProgress and Resolved → in_progress; Completed and Removed → done |
project | System.TeamProject |
description | System.Description as Markdown; when it is empty, "Repro steps" (where bugs keep their text) |
labels | System.Tags, split on ; |
priority | Microsoft.VSTS.Common.Priority |
assignee, reporter | System.AssignedTo, System.CreatedBy |
parent | System.Parent, or the reverse hierarchy relation |
resolvedAt | Closed date, otherwise resolved date |
statusCategory needs one extra request per project (the work item types and their states), cached for the life of the instance. It is best effort: when that request fails, the ticket is returned without a category.
Ticket.fields
These fields are copied when present, under readable names: Acceptance criteria, Repro steps, System info, Story points, Effort, Size, Original estimate, Remaining work, Target date, Severity, Value area, Area, Iteration, Reason, Board column. Rich text is converted to Markdown.
custom_fields adds more by reference name; a field without a known label keeps its reference name as the key:
- id: boards
type: azure-boards
organization: acme
projects: [Platform]
token_env: AZURE_DEVOPS_PAT
custom_fields: [Custom.RiskLevel, Custom.CustomerName]Search
A neutral TicketSearchQuery is turned into WIQL. Values go into quoted literals.
| Query field | WIQL |
|---|---|
projects (or the entry's projects when absent) | [System.TeamProject] IN ('Platform') |
text | ([System.Title] CONTAINS '…' OR [System.Description] CONTAINS '…') |
statusCategories | [System.State] IN (…) with the state names that belong to those categories |
updatedSince | [System.ChangedDate] >= '…' |
| always | ORDER BY [System.ChangedDate] DESC |
- State names are defined per project, so a
statusCategoriesfilter needs a project: in the query or on the entry. Without one the search fails withINVALID_INPUT. Because the same state name can sit in different categories for different work item types, results are filtered once more by category after loading. - WIQL returns ids only and has no offset. A search reads at most the first
AZURE_MAX_SEARCH_RESULTSmatches; titles and states are then loadedAZURE_BATCH_SIZEat a time. Work items the token cannot read are left out of the page. textis cut to 250 characters.
Native WIQL
import { createSafran } from "@safran/core";
await using safran = await createSafran({ profile: "safran.yaml" });
const wiql = "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = 'Platform' AND [System.Tags] CONTAINS 'iade'";
const page = await safran.tickets.search({ native: wiql }, { tracker: "boards" });
for (const item of page.items) console.log(item.key, item.title);native is sent as written. A query Azure DevOps rejects (HTTP 400 or 422) becomes INVALID_INPUT with the server's message in the hint.
Comments, links, history, attachments
- Comments are read oldest first with the server's continuation token; deleted comments are skipped. The comments resource is a preview API: the connector asks for
<api_version>-preview.4. - Links returns work item relations (
parent,child, and other link types by their name in lower case) with the linked item's title and state, then hyperlinks and artifact links asweblinks. Links to pull requests and commits are turned fromvstfs:///URIs into web URLs. Titles are loaded for at mostAZURE_BATCH_SIZElinked items; the rest are returned with their id only. - History is read from work item updates. Bookkeeping fields that change on every revision (revision number, changed date, watermark and similar) are dropped; added and removed relations appear as
Linkentries. Values are cut toAZURE_HISTORY_VALUE_CHARScharacters. - Attachments are the work item's
AttachedFilerelations; ids are GUIDs. A download must name an attachment of that work item (NOT_FOUNDotherwise), is refused aboveMAX_ATTACHMENT_BYTES, and an HTML answer for a file that is not HTML is reported asAUTH_FAILED(it is the sign-in page).
Limits
| Constant | Value | Meaning |
|---|---|---|
DEFAULT_PAGE_SIZE / MAX_PAGE_SIZE | 50 / 100 | Comments, history entries and search results per page. |
AZURE_MAX_SEARCH_RESULTS | 1000 | Matches one search can page through. |
AZURE_BATCH_SIZE | 200 | Work items loaded per batch request; also the cap on linked items with titles. |
AZURE_HISTORY_VALUE_CHARS | 500 | Characters kept of each old and new value in history. |
AZURE_MAX_PROJECT_PAGES | 10 | Pages of 200 projects read by listProjects. |
MAX_ATTACHMENT_BYTES | 50 MiB | Largest attachment that is downloaded. |
Known caveats
This connector is implemented from Microsoft's REST documentation (version 7.1) and tested against recorded-shape fixtures; it has not been run against a live organization. See verification status. The following are marked UNVERIFIED in the source:
- Quotes in search text. A single quote inside a WIQL literal is written twice. The WIQL syntax page shows quoted literals but not this rule; it is how the query editor behaves.
- State categories. The connector expects the work item type list of a project to embed each type's states with their category. The documented per-type resource has exactly that shape; the list was not confirmed to. If it does not, tickets come back without
statusCategoryand astatusCategoriessearch matches nothing. - Pull request and commit links. The
vstfs:///Git/PullRequestId/…andvstfs:///Git/Commit/…layouts are not in the REST reference. A URI of another shape is returned unchanged as the link's URL.
One more thing to know: the comment id is read from id, and from commentId when id is absent, because the reference and its sample payload disagree.
See also
- Azure Repos, the code host for the same organization. It links pull requests to work items by id.
- Connectors overview for the rules shared by all connectors.
- Tickets in the SDK.