Help needed in triggering an Team City Build

Answered

Hi Team,

 

I am looking some reference/examples on triggering a build with adding new system.properties parameter using buildqueue Post API call. Can you please let me know how can we add a new parameter and kickoff the build ?

 

Thanks 

Chaitanya

0
3 comments
Avatar
Fedor Rumyantsev

Hello Chaitanya,

Some basic examples regarding the POST to /app/rest/buildQueue could be found here: https://www.jetbrains.com/help/teamcity/rest-api.html#RESTAPI-Buildnodeexample (and example of build triggered with parameters is the second there).

A minimal example including the system.* property:

<build>
<buildType id="<build configuration ID>"/>
<properties>
<property name="system.example" value="The best sample value in the state."/>
</properties>
</build>

Please let me know if this helps.

0

Thanks for your response 

I want to create a new "SearchString" System.Property so tried with below format but no luck.

In general i am able to trigger a build using (buildqueue post) with the below Json format data but

after adding the SearchString tag as below i am able to trigger the build but this new property is not showing up in the parameters.

1. {"buildType": {"id": "IDOFTHETEST"},"properties":{"task":"DATA"},"property":{"name":"system.SearchString", "value":"Test"}} --> (Not working)

2. {"buildType": {"id": "IDOFTHETEST"},"properties":{"task":"DATA"},"name":"system.SearchString", "value":"Test"} ---> (Not working)

Pls let me know if i am doing some thing wrong here. Thanks in advance.

0
Avatar
Fedor Rumyantsev

Hello!

With JSON format, please give a try to this format:

{
"buildType": {
"id": "IDOFTHETEST"
},
"properties": {
"property": [{
"name": "task",
"value": "DATA"
}, {
"name": "system.SearchString",
"value": "Test"
}
]
}
}
0

Please sign in to leave a comment.