$locator usage

Hello, 

I am trying to get for each build type the lastest : finished failed, finished successed, running.

 

I've seen that this request one by one can do the job :

api/rest/buildTypes/?fields=buildType(id,name,projectId,builds($locator(status:failure,running:false,canceled:false,count:1),build(id,number,status,statusText))

 

but, can't it be possible to do someting like :

api/rest/buildTypes/?fields=buildType(id,name,builds($locator(item(status:FAILURE,state:finished,count:1),item(status:SUCCESS,state:finished,count:1),item(state:running,count:1)),build(number,id,webUrl))),count

using item dimension (even one) seems not working like a “normal” locator 

 

but as exemple doing that work but only for a BuildType

api/rest/builds/?locator=item(buildType:id,status:FAILURE,state:finished,count:1),item(buildType:id,status:SUCCESS,state:finished,count:1),item(buildType:id,state:running,count:1)

 

 

 

Thank you 

0
1 comment
Hi ,

I'm afraid it's not possible to request all parameters combined at the same time currently. Instead of retrieving builds based on buildType, we can split your request into three separate ones: one for failed builds, one for successful builds, and one for builds that are currently running. The approach achieves the same outcome with just three requests in total.

app/rest/buildTypes?fields=buildType(id,name,builds($locator(status:FAILURE,state:finished,count:1),build(number,id,webUrl))),count

I also have submitted a feature request(Get for each build type the lastest builds: finished failed, finished successed, running with $locator in a request : TW-85166 (jetbrains.com) (https://youtrack.jetbrains.com/issue/TW-85166/Get-for-each-build-type-the-lastest-builds-finished-failed-finished-successed-running-with-locator-in-a-request)) on your behalf. To ensure we capture your ideas effectively, we invite you to share any feature requests/bugs at Youtrack(https://youtrack.jetbrains.com/issues/TW).
0

Please sign in to leave a comment.