Loading classes and services

Loading plugin classes

To load classes from specific plugin, you must use WithPlugin annotation with plugin key (or multiple keys) as argument.

Using plugin services

To bind plugin service to script variable, you must use PluginModule annotation without any arguments. Not all services might be available this way.

Shortcut for system services

You can use StandardModule annotation to bind Jira services. It's pretty much a shortcut for ComponentAccessor.getComponent(ServiceClass)

Examples

Example with all annotations
import com.atlassian.greenhopper.service.rapid.view.RapidViewService
import com.atlassian.jira.security.JiraAuthenticationContext

@WithPlugin('com.pyxis.greenhopper.jira')
@PluginModule
RapidViewService rapidViewService
@StandardModule
JiraAuthenticationContext authenticationContext

return rapidViewService.getRapidView(authenticationContext.loggedInUser, 1605L).get()