TeamCity Console

From Evgeny Goldin

Jump to: navigation, search



This TeamCity plugin provides two additional tabs in Administration => Diagnostics area:


Download plugin's archive and copy it to TeamCity plugins directory, ~/.BuildServer/plugins by default. The plugin was tested with TeamCity 7.1.


This tab allows you to evaluate a Groovy expression in the context of TeamCity server, similarly to Jenkins Script Console and Groovy Web Console.

  • Click Evaluate or press Alt+R or Tab and then Enter to run the script.
  • Lines starting with # are ignored.
  • Use and o.dump() to see internal details of any object.
  • If evaluation results in an object from TeamCity domain - its Open API super-classes and interfaces are also displayed, try evaluating server.

Script Context

There are a number of variables and helper functions available in the script context.

Name Type Description Example
request HttpServletRequest Current HTTP request request.headerNames.toList()
context ApplicationContext Plugin's Spring context. context.getBean( 'buildServer' )
server SBuildServer TeamCity server instance. server.projectManager.activeProjects
c Method accepting a String ClassLoader.loadClass( 'className' ) wrapper.
  • Allows to omit 'jetbrains.buildServer.' from the class name or use 'j.b.' instead
c( 'web.util.SessionUser' ).getUser( request )
b Method accepting a String (bean name) or Class (bean type) Attempts to retrieve Spring bean or beans specified in all contexts b( 'buildServer' ).properties


Feel free to send me your scripts, which I'll make available here. Here are some examples to get you started:

[ request, context, server ]
new String( request.request.postData )
request.headerNames.collect{ [ it, request.getHeader( it )] }
server.history.getEntries( true ).join( '\n' )
assert server == context.getBean( 'buildServer' )
c( 'web.util.SessionUser' ).getUser( request ).associatedUser.descriptiveName
b( 'buildServer' ).properties
b( c( 'web.openapi.SimplePageExtension' )).values()


This tab provides you a detailed report of all existing beans in plugin and server Spring contexts with links to TeamCity Open API Javadocs.


Provided By
Source Code GitHub
Build Server Gradle
Download Artifactory Online
Personal tools