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.

1 comment
Comment actions Permalink

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

0

Please sign in to leave a comment.