List all builds of type, and PlaceId question

Hi

How do I obtain a list of all the builds of a particular buildtype? Ideally, all the pinned builds with a certain tag but I'm happy with just all builds of a particular buildtype.

Also, which PlaceId is the right one to add a tab to this type of page: https://teamcity/viewType.html?tab=buildTypeStatusDiv&buildTypeId=bt2

thanks!

donald

4 comments

Answering my own question,

SBuildType.getHistory() returns a list of SFinishedBuild.

PlaceId.BUILD_CONF_TAB is the right tab extension.

This produces another question, though: why can't the build conf tab handle a POST?  Posting a form to /viewType.html gives me a blank screen.  Posting a form to /viewLog.html gives me back a page as I'd expect.

0

If you need to handle post requests, you can register your own  controller (see jetbrains.buildServer.web.openapi.WebControllerManager  class). Controllers that handle viewType.html and viewLog.html pages  could handle your post requests too, but this may cause some  unpredictable bugs, especially when parameter names intersect. So I  would recommend to register custom controller to some url and forward  your post requests to this url.

0

I'm making sure the form fields in the POST request include the ones in the GET request, so I'd assume the viewType controller would handle it.  The same technique works with the viewLog page, but with viewType I just get a blank screen when I do a POST.  I'm running TeamCity 5.0.2, maybe this behaviour has changed since then?

0

Donald,

Sorry for the delay in replying.

Apparently, viewType.html does not support POST requests. Is it important for your task somehow?
If you need to handle POSTs, it' better to create your own controller for that.

0

Please sign in to leave a comment.