We are developing BitBucket add-on, which for every BB project creates a HC room and then links every newly created project repository with that HC room.
I tried to base the code on com.atlassian.bitbucket.internal.hipchat.notification.configuration.rest.NotificationConfigurationResource. The relevant fragments are below.
However now add-on fails to start due to ERROR [spring-startup] c.a.plugin.osgi.factory.OsgiPlugin Detected an error (BundleException) enabling the plugin 'org.xxx.cbs.bitbucket.xxx-bitbucket-plugin' : Unresolved constraint in bundle org.xxx.cbs.bitbucket.xxx-bitbucket-plugin [127]: Unable to resolve 127.0: missing requirement [127.0] osgi.wiring.package; (osgi.wiring.package=com.atlassian.bitbucket.internal.hipchat.notification.configuration). This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN