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?

9 comments

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?

1

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)

0

I understood: it's because of dash symbol. How can I search ",:-( )" symbols in my props?

Thank you for your response!

0

It's finally clear: (name:inner_branch,value:($base64:<Encoded branch name>)).

0

Thank you for your help!

It would be awesome to have a bit more examples for parameters / properties on API description page. :-)

0

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" .../>

0

Please sign in to leave a comment.