I'm trying to use com.tempoplugin.team.api.TeamManager in a behaviour script. Normally I would do something like this
@WithPlugin('com.tempoplugin.tempo-teams')
@PluginModule
TeamManager teamManager
but in a behaviour teamManager is always null.
This questions deals with the same issue but it doesn't have a resolution https://community.atlassian.com/t5/Atlassian-Marketplace-questions/Use-my-own-plugin-in-Behaviours-REST/qaq-p/214545
I figured it out. The following works
PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor()
Class teamManagerClass = pluginAccessor.getClassLoader().findClass("com.tempoplugin.team.api.TeamManager")
TeamManager teamManager = (TeamManager)ComponentAccessor.getOSGiComponentInstanceOfType(teamManagerClass)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.