Skip to content

Azure DevOps Automation

Agentic Unit can be triggered from an Azure DevOps work item, a Logic App, or another automation that can send an authenticated web request.

Before You Begin

Ask an Agentic Unit administrator to create an Azure DevOps trigger token for your team. The token determines the team, channel, and default agent for every request that uses it. It is shown only once.

Store the token in the automation's approved secret store. If it is lost or exposed, revoke it and create a replacement. Never put it in a work item, prompt, repository, or log.

Request

Replace <stage> with the environment you use:

POST https://api.<stage>.ai-agent.vwfs.io/webhook/jobs/v2/jobs/dispatch
Authorization: Bearer <trigger-token>
Content-Type: application/json

Send a body like this:

{
  "prompt": "Work item 12345 in Azure DevOps project \"Coding Agent\". Fix the failing test in the login flow.",
  "context": {
    "repositories": [
      {
        "name": "example-repo",
        "branchName": "main"
      }
    ]
  },
  "notify": {
    "email": "developer@example.com"
  },
  "metadata": {
    "resource": {
      "id": 12345,
      "rev": 7,
      "url": "https://dev.azure.com/example/project/_apis/wit/workItems/12345",
      "fields": {
        "System.TeamProject": "Coding Agent",
        "System.Title": "Fix the failing login test"
      }
    }
  }
}
Field Meaning
prompt Required instruction for Agentic Unit. Name the Azure DevOps project and work item here.
context.repositories Repositories Agentic Unit should use. The first entry is the primary target.
branchName Existing starting branch. If it cannot be found, Agentic Unit uses the repository's default branch.
notify.email Optional completion notification.
metadata.resource The complete Azure DevOps resource block. It is preserved for status callbacks.

There is no separate Azure DevOps project field in the dispatch schema. Include the project in prompt; this avoids a slower organisation-wide repository search and ambiguity when projects contain repositories with the same name.

Send the complete resource block, not only its id. Agentic Unit stores it and returns it unchanged in the work item status callback, so every value your Logic App expects later must be present in the original request.

Response

A successful dispatch returns HTTP 202:

{
  "message": "Agent job dispatched successfully",
  "requestId": "00000000-0000-0000-0000-000000000000",
  "status": "QUEUED"
}

Keep the requestId for monitoring and support. A queued response means Agentic Unit accepted the request; it does not mean the job has finished.

Common error responses are:

  • 400 — the payload is invalid or required context is missing.
  • 401 — the bearer token is missing, invalid, or revoked.
  • 403 — the token is not allowed to use the requested team or resource.

Migrating From The Legacy Endpoint

The unauthenticated /webhook/jobs/events format is legacy. New integrations must use the v2 dispatch endpoint.

Legacy field Current field
type: "azuredevops" Removed; the trigger token identifies the channel.
eventType Removed.
resource metadata.resource
resource.manualTrigger.codingAgentInput.additionalInstructions prompt
additionalParameters.repositories context.repositories
additionalParameters.branchName context.repositories[0].branchName
No authentication Authorization: Bearer <trigger-token>
Platform-selected agent Agent selected by the trigger token

Test The Automation

Test with a work item and repository owned by your team. Confirm that:

  • The request uses the correct stage and includes the bearer token.
  • The prompt names the Azure DevOps project and work item.
  • metadata.resource contains everything needed by the status callback.
  • The repository name is correct and the requested branch exists.
  • The response contains a requestId and QUEUED status.
  • Agentic Unit starts and returns work for the expected repository.