2
votes

We've recently implemented Team City and I've been tasked with making it work with our existing VSTS environment. We'd ideally like to have Team City build and VSTS release. We've got the Team City generated Artifacts sitting inside VSTS however you can't trigger CI off them as per this article here; https://www.visualstudio.com/en-us/docs/build/concepts/definitions/release/artifacts

What I'd like to do is have Team City trigger the release via the VSTS REST API. I have have followed the documentation here https://www.visualstudio.com/en-us/docs/integrate/api/rm/releases but I'm having issues getting VSTS to use the Team City artifacts. No matter what I try I get the following error: "VS402962: No artifact version id is specified corresponding to artifact source 'TeamCity Build'. Specify a valid value and try again."

This is what my JSON body for the REST call looks like:

{
  "definitionId": 13,
  "description": "Build from TeamCity",
  "artifacts": [
    {
      "alias": "Build Dev (TeamCity)",
      "instanceReference": {
        "id": 160,
        "name": "160"
      }
    }
  ]
}

I have tried this with and without the name as per this question: VS402881: No artifact version is specified corresponding to artifact source 'MyBuild.' Release Management vNext REST API but I'm not having any luck.

1

1 Answers

0
votes

I have found the issue. You need to remove (Team City) from the alias as it's not part of the Artifact Alias.