Accessing a build from a custom tab in a plugin
I am having a hard time figuring this out, and I am sure it is a simple answer. What do I need to inject into my SimplePageExtension which implements CustomTab class to get access to the current SBuild object? I tried injecting an SBuild object directly thinking maybe it was scoped, but it could not be injected. Thanks.
Please sign in to leave a comment.
If you are writing custom tab for the build results page then there are two choices:
- you can extend your custom tab from jetbrains.buildServer.web.openapi.ViewLogTab and use getBuild() method
- you can ask for SBuildServer interface in the constructor of your custom tab and use findBuildInstanceById(buildId) method, the build id can be obtained from the HTTP request parameter: buildId
--
Pavel Sher