Find TeamCity build with API by parameter
Answered
- I added parameter to my build called "foo".
- I set <property name="foo" value="bar"/> when I create build. It is set successfully.
- Then I search for my build using query: `/httpAuth/app/rest/builds/?locator=property:(name:foo,value:bar)` and nothing is found.
How can I find build by parameter / property?
Please sign in to leave a comment.
Hello,
Did you run the build? Could you please open build Parameters tab and check that parameter is correct?
I tried the same request and it works for me. What TeamCity version do you use?
Wow, I checked it for other properties and it worked.
It works with: (name:inner_branch,value:master)
But doesn't with: (name:inner_branch,value:feature/SM-123)
I understood: it's because of dash symbol. How can I search "
,:-( )" symbols in my props?Thank you for your response!
It's finally clear: (name:inner_branch,value:($base64:<Encoded branch name>)).
Thank you for your help!
It would be awesome to have a bit more examples for parameters / properties on API description page. :-)
Still unclear.
I have this prop:
I use this query: /httpAuth/app/rest/builds/?locator=property:(name:qhash,value:6dab44a81996d1b041830d2b8ecd8677)
And I get <builds count="0" .../>
TeamCity 10.0.1 (build 42078)
Created new post here: https://teamcity-support.jetbrains.com/hc/en-us/community/posts/203372504-API-doesn-t-search-by-property
Hi Robert,
The supported locators and examples are present in the section: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-Locator.