REST api for Builds filtered by Revision not working
Hi,
Recently my Teamcity version upgraded to TeamCity Enterprise 2018.1.4 (build 58724) Since then API to get the builds by Revision ID is not working.
Sample API I am executing is <InstanceURL>/app/rest/builds?locator=revision(version:XXXXXX27970b970c76cb91e1f215XXXXX)
Can somebody help here what has changed in this version?
Please sign in to leave a comment.
Hi Yuvam,
please make sure that the revision you are using should return anything. I've been testing the request and it seems to be working just fine on my end. If there are many builds, they don't fit the default filter, or you are going for older revisions, you might need to add some parameters such as lookupLimit or defaultFilter:false. More info to that here: https://www.jetbrains.com/help/teamcity/rest-api.html#RESTAPI-BuildLocator
Hi,
I encounter the same issue with TeamCity Enterprise 2019.1.5 (build 66605).
For a given revision which has a list of builds in the Changes tab of the UI, the API returns nothing. I can't find a pattern of which revisions have no empty results, some request behave as expected, other don't. I tried several query parameters, such as lookupLimit and defaultFilter.
I plan to upgrade to 2019.2, I hope this will help.
EDIT: 2019.2 did not solve the issue, some recent revisions are not shown in the API...
Hi Mael,
it's not fixed because we have not found this to be an issue. What values are you using for lookup limit and default filter? Also could you post here a response of a request that should return values but does not?
Hi Denis,
Here is a working request and response for a given (Svn) revision :
and a non working one, whatever the lookupLimit is
which has the following result in the UI :
Both revisions are from today.
Thanks
Hi, and thanks for sharing the screenshot (it was duplicated, if you intended to post two different ones they were unfortunately shared). The screenshot shows a bunch of different builds with different sets of changes. Could you pick some of those and check their changes tab? Feel free to obscure the files changed but please make sure that the revision number is displayed. The revisions parameter has some restrictions in the builds that it returns, but as long as there are builds with that vcs root in it, they should appear. A screenshot of the changes tab for such a build displaying the revision would probably help us identify whether the request is misbehaving or some of the conditions are not being met.
Hi, please find the following screenshots. Note that we have a single VCS root.
Changes tab, for the revision 267676 author.
Search by revision. Note that every build shown here has the revision in the changes drop-down
Here's what I found in the rest log for my API query:
I tried a few things :
Still no result.
Thanks
Hi Mael,
thanks but I might have not explained myself properly. I'd like to ask you to access one of the builds shown in the results from the revision search in the UI (such as #30550), and access the changes tab of that specific build, and check that it's displayed there. Not in the dropdown, not in the general "changes" page, but specifically there.
Hi Denis, here is the changes of one of the builds, with the revision 267676 :