Is there regex support for BuildTypeLocator in TeamCity REST API?

Are use of regex supported in locators in URLs to the REST API? specifically the BuildTypeLocator? I saw some hints of it being supported but struggling to find more info on the web or finding out myself how to use it with trial and error. For example if I want get all builds matching the follow regex: ".*LIVE*." how would the URL look like? last attempt that I tried without luck was /app/rest/builds?locator=buildType:(name:.*LIVE.*)

0
1 comment

Hello!

Unfortunately, no, regex matching for name is not supported - dimension name will try to find build type with a name that equals (case-insensitive) to the one supplied in request URL. Regex is supported for certain dimensions where you can explicitly select match type (for instance, property dimension of BuildLocator).

I would suggest to fetch all build configurations and filter them on client side; if you can limit the response by supplying project or affectedProject dimensions, this would help to optimize the request. Can you please let me know more about your use case so I could try to assist further?

0

Please sign in to leave a comment.