Run Build Configuration with REST API

Hi,

how can I Run a build configuration with the REST API?

Thanks in advance,
Alexander

4 comments
Comment actions Permalink

THis is possible, but not via REST API yet, see details in the related issue: http://youtrack.jetbrains.com/issue/TW-14941

0
Comment actions Permalink

This the URL I use:

https://teamcity/httpAuth/action.html?add2Queue=<buildId>

<buildId> = The buildtype of the build configuration you want to run

You can also optionally pass in build parameters to the build via the URL. Use the format "&name=<parameterNameToSet>&value=<valueOfParameter>". You can specify as many values as you like.

For example to set env.Environment to "Dev":
https://teamcity/httpAuth/action.html?add2Queue=<buildId>&name=env.Environment&value=Dev

Note:
You have to authenticate with a user account that has permission to start the build and this is usually done by setting the HTTP headers with the appropriate credentials. If you let guest users kick off the build configuration, you may be able to replace httpAuth with guestAuth, but I have never tried this.

0
Comment actions Permalink

Thanks!
That worked.

Which HTTP method is preferred here?

0
Comment actions Permalink

I beleive POST is fine.

0

Please sign in to leave a comment.