ScriptRunner limitations

My question is what are real limitation of SR, how far I can go without moving to plugin development.

For example, I would like to update app licenses to Developer one.
I can import:
import com.atlassian.upm.api.license.RemotePluginLicenseService
but when I try with:

import com.atlassian.upm.license.internal.PluginLicenseRepository

I get error Unable to resolve class

On SC documentation I only see this:
but there is nothing about com.atlassain.* limitation.

Best Regards,

ok seem like I’ve found answer myself…
correct code is:
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.atlassian.upm.license.internal.PluginLicenseRepository

PluginLicenseRepository pluginLicenseRepository;

1 Like

Looks like you have found the answer, by default scripts only have access to classes that have been imported via OSGi from the ScriptRunner app itself.

If you want to access classes from other apps, you can use the @WithPlugin annotation which adds the ClassLoader for that app to the ClassLoader used by ScriptRunner scripts, you should then be able to load classes from that app.

You can also use @PluginModule to inject instances of components from other apps.



Documentation for these annotations can be found here: