I have some builds. Each build has two tags. Tags show module name and version. So tags loogs like one-module and 1.2.3 or two-module and 4.5.6.
I can do this:
/httpAuth/app/rest/builds/?locator=tags:one-module,branch:unspecified:any&fields=build(tags(tag))
I will get this:
{
"build": [
{
"tags": {
"tag": [
{
"name": "1.2.4"
},
{
"name": "one-module"
}
]
}
},
{
"tags": {
"tag": [
{
"name": "1.2.3"
},
{
"name": "one-module"
}
]
}
}
]
}
Now I want to get latest build with tags one-module and 1.2.4. How I can do this?
I try this:
/httpAuth/app/rest/builds/?locator=tags:one-module,1.2.4,branch:unspecified:any&fields=build(tags(tag))
But I got this:
Error has occurred during request processing (Bad Request).
Error: jetbrains.buildServer.server.rest.errors.LocatorProcessException: Bad locator syntax: Invalid dimension name :'1.2.4'. Should contain only alpha-numeric symbols or be known one. Details: locator: 'tags:one-module,1.2.4,branch:unspecified:any', at position 16
Invalid request. Check locator is specified correctly.
I have TeamCity version 9.1.6. TeamCity REST API BuildLocator documentation says:
tags: - ","(comma) - a delimited list of build tags (only builds containing all the specified tags are returned)
So, I try to select build by 2 or more tags like this. This doesn't work?
What I am doing wrong? How I can get build latest build by 2 or more tags?
I accidently find the way to get build by two or more tags.
Solution: use build locator this way:
tags:(one-tag,two-tag,three-tag,etc-tag)I am not sure it is correct solution. If it is correct JetBrains just forgot to update docs for TC REST API. Or it is just something internal for TeamCity. I asked about here in comments to the docs.