TeamCity Plugin Development Help
 

Storing Plugin State and Settings

Edit page Last modified: 09 January 2020

Most of the plugins need a location to store their state and settings.

By state we mean the internal plugin data which cannot be easily computed from scratch and is usually not visible to the users of the plugin.
The state can be either global or associated with some TeamCity entity, such as a build or a build configuration.

By settings we understand user-defined settings, specified either via the user interface or DSL.
The plugin settings can be global or associated with TeamCity entities, such as a build configuration or a project.

Usually both the state and settings should survive the server restart.

In most cases plugin settings will be serialized and deserialized automatically by the TeamCity server itself; however, to serialize the state, some dedicated code should be provided by the plugin author, except for the cases when the plugin state can be calculated based on other TeamCity entities.
For instance, a plugin whose state depends on build tests can restore its state during the server startup by processing recent builds.