SuperAPI AI Directory

boards-team-active-work

Coding & development

View repository

Updated 10-15 21:11

About this skill

Team in-progress work and dependencies

This Skill gets the team's Requirements-level backlog list, filters out the entire team'sin-progressitems, adds parent-child and dependency information, and then presents them by blocking status, priority, and Sprint assignment.

Project selection

  • If the user provides a project name (for example "Contoso project"), use it directly and do not call the project list API.

  • If not provided, ask the user to provide it once.

  • If still not provided, list the projects for the user to choose from:

    curl -sS -u ":$AZURE_DEVOPS_PAT" \
      "https://dev.azure.com/$AZURE_DEVOPS_ORG/_apis/projects?%24top=500&api-version=7.1"
    
  • Do not continue until the user provides or selects a project.

Team selection

  • If the user provides a team name, use it directly and do not call the team list API.

  • If not provided, ask the user to provide it once.

  • If still not provided, list the teams of the selected project for the user to choose from:

    curl -sS -u ":$AZURE_DEVOPS_PAT" \
      "https://dev.azure.com/$AZURE_DEVOPS_ORG/_apis/projects/{project}/teams?%24top=500&api-version=7.1"
    
  • Do not continue until the user provides or selects a team.

In the project list response header (curl -D - is visible) there is x-ms-continuationtoken , add &continuationToken={token} to get the next page; for the team list, paginate with %24skip .

Connection and authentication

Always use curl to call the Azure DevOps REST API directly, with each command carrying its own authentication parameters.

  • Organization: read the environment variable AZURE_DEVOPS_ORG(organization name, for example contoso). If it is not set, ask the user once; if the user gives a URL, extract the organization name from https://dev.azure.com/{org} or https://{org}.visualstudio.com .
  • Token: send the PAT with Basic authentication:-u ":$AZURE_DEVOPS_PAT"; if only AZURE_DEVOPS_EXT_PATis set (the variable used by the Azure CLI azure-devops extension), use that instead. When switching to a Microsoft Entra ID token, replace it with -H "Authorization: Bearer $AZURE_DEVOPS_TOKEN". If neither is set, ask the user to set AZURE_DEVOPS_PAT in their own terminal and retry, then stop. Read the token only from environment variables: do not ask the user to paste the token into the conversation, and do not print it or write it to a file.
  • PAT permission scope:Work Items (Read)、Project and Team (Read)。
  • Encoding: URL-encode the project and team names in the path (write spaces as %20); in the query string write $ as %24(for example %24top) to avoid shell expansion.
  • Errors: HTTP 401, 403, 203, or a response that is an HTML login page means the token is invalid, expired, or has insufficient permissions; report it and stop; HTTP 404 means the organization, project, or team name is wrong.
  • Windows PowerShell: call curl.exe(not the curl alias), and write the environment variable as $env:AZURE_DEVOPS_PAT; PowerShell does not support <<'EOF', so first write the JSON body to a temporary file, then send it with --data-binary "@body.json" .

Steps

  1. Determine the project and team according to the rules above.

  2. Get all Iterations of the team (a single call provides both the current Sprint and the end date of each Iteration):

    curl -sS -u ":$AZURE_DEVOPS_PAT" \
      "https://dev.azure.com/$AZURE_DEVOPS_ORG/{project}/{team}/_apis/work/teamsettings/iterations?api-version=7.1"
    

    attributes.timeFrame is current is the current Sprint. When the team has not yet scheduled the next Sprint, the last Sprint that has ended will still be marked as current:finishDate even if it is earlier than today, use it anyway, but note when presenting it that "the current Sprint ended on {date}". Create the path → attributes.finishDate mapping table; the format ofpath is the same as the work item's System.IterationPath (for example Contoso\Sprint 12), and can be compared directly.

  3. Get the work item IDs of the team's requirement-level backlog:

    curl -sS -u ":$AZURE_DEVOPS_PAT" \
      "https://dev.azure.com/$AZURE_DEVOPS_ORG/{project}/{team}/_apis/work/backlogs/Microsoft.RequirementCategory/workItems?api-version=7.1"
    

    IDs are in workItems[].target.id. If the list is empty, go directly to the empty result message in step 5.

  4. Use WIQL to filter in-progress items on the server side (the entire team, regardless of assignee). Fill the IDs from step 3 into IN (...)(query in batches when there are more than 1,000 IDs):

    curl -sS -u ":$AZURE_DEVOPS_PAT" -X POST -H "Content-Type: application/json" \
      "https://dev.azure.com/$AZURE_DEVOPS_ORG/{project}/_apis/wit/wiql?api-version=7.1" \
      --data-binary @- <<'EOF'
    {"query": "SELECT [System.Id] FROM WorkItems WHERE [System.Id] IN (101, 102, 103) AND [System.State] IN ('Active', 'Committed', 'Doing')"}
    EOF
    

    "In Progress" corresponds to the in-progress state of each built-in process: for Agile and CMMI it is Active, for Scrum it is Committed, for Basic it is Doing. When the project uses a custom process, use that process's in-progress state name instead.

  5. When the response's workItems is empty, explain that this team has no in-progress backlog items, then stop.

  6. Use batch calls to get the fields and relations of the filtered items (at most 200 IDs each time):

    curl -sS -u ":$AZURE_DEVOPS_PAT" -X POST -H "Content-Type: application/json" \
      "https://dev.azure.com/$AZURE_DEVOPS_ORG/{project}/_apis/wit/workitemsbatch?api-version=7.1" \
      -d '{"ids":[101,102],"$expand":"Relations","errorPolicy":"Omit"}'
    

    $expand cannot be specified together with fields , so this time all fields will be returned; only use System.Id、System.Title、System.State、System.AssignedTo、System.WorkItemType、System.ChangedDate、System.IterationPath、Microsoft.VSTS.Common.Priority、System.Parent。

  7. From each item's relations , collect the following IDs (the ID is the last segment of url , andattributes.name is the link's display name):

    • Parent item:System.LinkTypes.Hierarchy-Reverse(Parent)
    • Child item:System.LinkTypes.Hierarchy-Forward(Child)
    • Items blocked by this item:System.LinkTypes.Dependency-Forward(Successor, the other party must wait for this item to be completed)
    • Items this item depends on:System.LinkTypes.Dependency-Reverse(Predecessor, this item must wait for the other party to be completed)
    • Related items:System.LinkTypes.Related
  8. After excluding the IDs already obtained, use one batch call to get all the above items' System.Id、System.Title、System.State、System.IterationPath:

    curl -sS -u ":$AZURE_DEVOPS_PAT" -X POST -H "Content-Type: application/json" \
      "https://dev.azure.com/$AZURE_DEVOPS_ORG/{project}/_apis/wit/workitemsbatch?api-version=7.1" \
      -d '{"ids":[201,202],"fields":["System.Id","System.Title","System.State","System.IterationPath"],"errorPolicy":"Omit"}'
    
  9. Determine each item's:

    • Whether it blocks other items: has any System.LinkTypes.Dependency-Forward(Successor) relation
    • Whether it is in the current Sprint:System.IterationPath equals the current Iteration from step 2 path
    • Priority:Microsoft.VSTS.Common.Priority
  10. Present the results in the format below.

Present results

First display the current Sprint:

Current Sprint: {Iteration name} (ends {Iteration end date, format YYYY/MM/DD})

When the team has no current Sprint, display "The team currently has no in-progress Sprint" instead, and treat group 3 as an empty group.


Then group in the following order; each item is assigned only to the first matching group, and within a group sort by Priority from smallest to largest (Priority 1 first):

  1. Items blocking other items
  2. High-priority items(Priority 1 or 2)
  3. Items due this Sprint(Iteration is the current Sprint)
  4. Other items

Display each item as:


{ID} — {title}

{When blocking other items, display:⚠️ Blocking other work items}

Field Value
Status {System.State}
Priority {Microsoft.VSTS.Common.Priority}
Changed Date {System.ChangedDate, format YYYY/MM/DD}
Iteration {last segment of System.IterationPath}
Iteration End Date {finishDate of that Iteration in the Step 2 reference table; displayed when no date is set or the team is not subscribed to that Iteration (unknown)}
Work Item Type {System.WorkItemType}

Parent:

  • Has parent:{ParentID} {parent title}
  • No parent:(none)

Child items:

Display as a table when there are child items:

ID Title Status
{ChildID} {child title} {child status}

Display when there are no child items:(none)

Dependencies:

Display when there is a Successor link (blocking other items):

⚠️ Blocking:

Display when there is a Predecessor link (depends on other items):

Depends on:

Display when neither exists:(none)


After listing all items, display a summary:

Summary:

  • Total items in progress for the team: {N}
  • Items blocking other items: {M}
  • High-priority items (1–2): {P}
  • Items due this Sprint: {Q}

Team:{team name} | Project:{project name}