How to retrieve server info from Agent? REST API Plugin!

Hi there,
I am trying to write my first team city agent plugin and a need to retrieve some server info related to previous builds (start time of last successful build, start time of last failed build etc etc).

Should I use the Rest Api from the agent side code to retrieve this info.



Comment actions Permalink


Using REST API (if it provides information that you need) is probably the easiest way to get the information without server-side TeamCity plugin.

But if you need that kind of information you probably need server-side plugin. Server-side plugin can then add properties to the starting builds, if necessary.

Can you describe what kind of plugin do you write?

Comment actions Permalink

Hi Yegor,

thanks for your answer. I will try it. I will use a jetbrains.buildServer.serverSide.ParametersPreprocessor in the server side part of my plugin.

What I want to do is a plugin that gives you all (even if the belong to "sub-project") the subversion changes that could have caused a build to fail.

At the moment, if I am not wrong, teamcity triggers a build if it detects changes in SVN or (supposing you are using Maven as build tool) if you use a Maven Snapshot Dependencies Trigger.

The problem with the second option is the following one :

Suppose I have project A (artifact a.jar) that depends on project B (artifact b.jar) that depends on project C (c.jar).
Suppose that I register all my maven and SVN triggers and somebody change sources in C ( changes) : a trigger builds c.jar, a second build builds b.jar and a third build (project A) tries to build a.jar.

Now if build in project A failed (because for example what have been committed on C,, is wrong) I dont know immediately from my teamcity A project report that somebody changed, and will take time to find out that was the cause of the problem.

I would like to write a plugin that when A build fails it finds all A dependencies (from pom.xml) and reports all SVN changes that could have caused the build to fail, even changes in all its dependencies.

I hope this is clear.

What do you think?


Message was edited by: roberto malagigi

Comment actions Permalink


> I will use a jetbrains.buildServer.serverSide.ParametersPreprocessor in the server side part of my plugin.
Sounds OK.

Yes, you are addressing a known issue and at some point we should implement it as a feature in TeamCity.
You might be interested in voting/watching the issue TW-2576 (Include changes from changed artifact dependencies in the build's change) and it's related issues.

Please consider sharing the plugin with the rest of TeamCity users!


Please sign in to leave a comment.