Finding out if an RTC build is tagged through the REST API
![]()
Hello!
I've learned a little about the resful apis, and am interesting in getting information about builds that we have applied a tag to.
I can successfully run this sort of query:
https://<my_jazz_location>/rpt/repository/build?fields=build/buildResult[buildDefinition/id='<my_build_id>']/(buildDefinition/projectArea/name|label|buildStatus|timeTaken)
I also noticed that you can list out different parameters besides buildStatus / label / timeTaken.
I found what looked to be a comprehensive list here:
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#build
I noticed 2 things:
1) compilationResults doesn't seem to work as a field
2) There is no field for tags
Can you suggest an alternative way with the REST API for me to check if a build has a tag associated with it?
Additionally, is there a limit to the amount of results returned, and is there a way to query for all results?
Any help would be appreciated!
|
Accepted answer
3 other answers
![]()
Based on my investigation, it seems that you cannot query for tags through the build rest-API.
I really wish you could.
I came up with an alternative plan:
1) Query for good builds, and add the itemId parameter
https://<jazz_repo>/jazz/rpt/repository/build?fields=build/buildResult[buildDefinition/id="<my_stream>" and buildStatus="OK" and buildState="COMPLETED" and personalBuild=false]/(buildDefinition/projectArea/name|buildStatus|buildState|label|timeTaken|personalBuild|startTime|timeWaiting|buildDefinition|itemId)
2) Using the itemId's, query this:
https://<jazz_repo>/jazz/resource/virtual/build/resultrecord/<itemId>
Unfortunately, this means that I have to loop for every itemId, through every stream (so, a double-for loop), whereas if the tag information was available as part of the build restful api, I could just have a single loop.
So, I would love to have that functionality! It's the difference of 1 minute vs. 20 minutes, so it'd be great to have in a future version of the restful api.
I also wonder.. what is the second site I'm hitting there? It doesn't seem to be part of the restful api; so, what is it? I see it referenced in a few docs on the web, so it's definitely valid. Is it ok for me to hit that link?
|
![]()
If anyone follows this thread, I have raised enhancement 279053 to make the request to add the tags field to the restful api.
Heres the link:
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=279053
|
![]()
Regarding paging, if there is more to the result, it should include a rel="next" URL in the top element.
e.g. for https://jazz.net/jazz/rpt/repository/build?fields=build/buildResult%5BbuildDefinition/id='rtc.jcb'%5D/(buildDefinition/projectArea/name%7Clabel%7CbuildStatus%7CtimeTaken)
the top element is:
<build Version="1.0.0" rel="next" href="https://jazz.net/jazz/rpt/repository/build?fields=build%2FbuildResult%5BbuildDefinition%2Fid%3D%27rtc.jcb%27%5D%2F%28buildDefinition%2FprojectArea%2Fname%7Clabel%7CbuildStatus%7CtimeTaken%29&id=_T3bhqxpKEeOwis1DfBnHNg&size=100&pos=100">
For more details, see the whitepaper link in the General Documentation section of:
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#General_documentation
|