Override artifact-dependencies through REST api

I'm attempting to override the default value for an artifact-dependency through the REST API. There doesn't appear to be any documentation on how to do this. What values do I have to provide in the POST content in order to get this working?

Here's what I'm currently using without success:

{

"buildType": {

        "id": "SimpleApiWithDependencies"

    },

"artifact-dependencies": {

        "build": [

            {

                "id": 9480,

                "type": "artifact-dependency"

            }

        ],

        "count": 1

    }

}

I'd expect that this would tell Teamcity to build the project SimpleApiWithDependencies using the artifacts from build 9480.

1 comment
Comment actions Permalink

I've answered my own question. I needed to fetch the project info from /httpAuth/app/rest/buildTypes/id:<buildTypeId> and then make the following changes to the artifact dependencies:

  • rename artifact-dependencies to custom-artifact-dependencies
  • change the value of revisionName to buildid
  • change the value of revisionValue to the build number of artifact project


{ "buildType": {    "id": "SimpleApiWithDependencies" }, "custom-artifact-dependencies": {

   "artifact-dependency": [       {          "id": "0",          "properties": {             "property": [                {                   "name": "cleanDestinationDirectory",                   "value": "true"                },                {                   "name": "pathRules",                   "value": "someArtifact.txt => deps"                },                {                   "name": "revisionName",                   "value": "buildId"                },                {                   "name": "revisionValue",                   "value": "56"                }             ]          },                    "source-buildType": {             ... this is copied exactly from the fetched project info          },          "type": "artifact_dependency"       }    ], "count": 1    } }

0

Please sign in to leave a comment.