0
votes

I want to cancel then start my build through url:

This how I starting my build:

http://<user name>:<user password>@<server address>/httpAuth/action.html?add2Queue=<build type Id>

but when I'm trying to cancel/stop it:

http://<user name>:<user password>@<server address>/ajax.html?comment=<cancel_comment>&submit=Stop&buildId=<internal_build_id>&kill

I'm getting exception:

Error message: Given kill operation code is null
TeamCity: 8.0.5 (build 27692)
Operating system: Windows Server 2008 R2 (6.1, x86)
Java: 1.7.0_21-b11 (Oracle Corporation)
Servlet container: Apache Tomcat/7.0.37

Trace: java.lang.IllegalArgumentException: Given kill operation code is null

Source: Accessing server by HTTP

I tried through REST API but didn't helped me.

1

1 Answers

1
votes

I analyze js code in TeamCity and found 2 solution

  • Kill build by process id :

yourTeamCityUrl/ajax.html?comment=%somment%&kill=%buildQueueId%&operationKind=2&_readd=&submit=Stop

  • Kill build by build id:

yourTeamCityUrl/ajax.html?comment=%comment%&submit=Stop&buildId=%active_build%&kill&operationKind=1

only need to add &operationKind=1