How to get list of user plugins via Java API?

The PluginAccessor class can return a Colletion of Plugin objects, which has a .isBundledPlugin() method.

I tried getting the list where isBundledPlugin() is false, but the results contains a lot more items (108) than what are displayed in manage apps (6).

I also tried PluginInfoProvider class, which has a .getUserPlugins() method. But that also returns more items (69) than expected (6).

An example among the 69:

{
  "name" : "psmq-plugin",
  "key" : "com.atlassian.psmq",
  "enabled" : true,
  "pluginInformation" : {
    "description" : "PSMQ - Provides Pretty Simple Message Queueing",
    "descriptionKey" : null,
    "version" : "4.22.2-REL-0028",
    "vendorName" : "Atlassian",
    "vendorUrl" : "http://www.atlassian.com/",
    "scopeKey" : {
      "empty" : true,
      "present" : false
    },
    "minJavaVersion" : null,
    "permissions" : [ {
      "name" : "all_permissions",
      "installationMode" : {
        "empty" : true,
        "present" : false
      }
    } ],
    "parameters" : { },
    "startup" : null,
    "moduleScanFolders" : [ ]
  },
  "pluginsVersion" : 2,
  "systemPlugin" : false,
  "unloadable" : false,
  "unloadableReason" : ""
}

That is from calling .getUserPlugins(), it is not a system plugin, it is not displayed in Manage Apps when you select “User Installed”, yet the API gives it to me.

How do I get the list of plugins that are “User Installed”?

Hi @KCWong,

Thanks for the question. I had a look at some sample code I have and we do this


import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.PluginAccessor;
import com.atlassian.plugin.metadata.PluginMetadataManager;
...

    public Collection<Plugin> getActualUserInstalledPlugins() {
        return pluginAccessor.getPlugins().parallelStream()
            .filter(pluginMetadataManager::isUserInstalled)
            .collect(toList());
    }

We also filter out some that we don’t need like UPM and CCMA/JMCA, etc.

Hope this helps.

James

On the Manage Apps page I got these in my SDK instance:

While calling the API as demonstrated gave me these:

Apache Commons FileUpload Bundle Property Value
.getKey org.apache.commons.fileupload-1.2.1
.getName Apache Commons FileUpload Bundle
.getPluginInformation.getDescription null
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName The Apache Software Foundation
.getPluginInformation.getVenorUrl null
.getPluginInformation.getVersion 1.2.1
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
Apache Felix Web Management Console Property Value
.getKey org.apache.felix.webconsole-1.2.8
.getName Apache Felix Web Management Console
.getPluginInformation.getDescription Web Based Management Console for OSGi Frameworks. See http://felix.apache.org/apache-felix-web-console.html for more information on this bundle.
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName The Apache Software Foundation
.getPluginInformation.getVenorUrl null
.getPluginInformation.getVersion 1.2.8
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
Atlassian Developer Toolbox Property Value
.getKey com.atlassian.devrel.developer-toolbox-plugin
.getName Atlassian Developer Toolbox
.getPluginInformation.getDescription A set of tools to aid plugin developers.
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName Atlassian
.getPluginInformation.getVenorUrl http://developer.atlassian.com/
.getPluginInformation.getVersion 2.0.17
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
Atlassian PDK Install Plugin Property Value
.getKey com.atlassian.pdkinstall
.getName Atlassian PDK Install Plugin
.getPluginInformation.getDescription
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName Atlassian Software Systems Pty Ltd
.getPluginInformation.getVenorUrl http://www.atlassian.com
.getPluginInformation.getVersion 0.6
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
Atlassian REST API Browser Property Value
.getKey com.atlassian.labs.rest-api-browser
.getName Atlassian REST API Browser
.getPluginInformation.getDescription Discover, browse, and try Atlassian’s rich set or REST and JSON-RPC APIs
.getPluginInformation.getParameters.# 1
.getPluginInformation.getParameters.atlassian-data-center-compatible true
.getPluginInformation.getVendorName Atlassian
.getPluginInformation.getVenorUrl http://developer.atlassian.com/
.getPluginInformation.getVersion 3.1.3
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
IGSL Config Migration Property Value
.getKey com.igsl.ConfigMigration
.getName IGSL Config Migration
.getPluginInformation.getDescription Migrates configuration and data
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName Integrated Global Solutions Limited
.getPluginInformation.getVenorUrl https://www.igsl-group.com/
.getPluginInformation.getVersion 1.0.0
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
IGSL LDAP User Attributes Property Value
.getKey com.igsl.LDAPUserAttributes
.getName IGSL LDAP User Attributes
.getPluginInformation.getDescription Synchronize LDAP user attributes to Jira user
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName Integrated Global Solutions Limited
.getPluginInformation.getVenorUrl https://www.igsl-group.com/
.getPluginInformation.getVersion 1.0.7
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
OSGi R4 Compendium Bundle Property Value
.getKey org.osgi.compendium-4.1.0
.getName OSGi R4 Compendium Bundle
.getPluginInformation.getDescription OSGi Service Platform Release 4 Compendium Interfaces and Classes.
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName OSGi Alliance
.getPluginInformation.getVenorUrl null
.getPluginInformation.getVersion 4.1.0
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
Quick Reload - Stealing time back from Maven since 2013. Just press up arrow! Property Value
.getKey com.atlassian.labs.plugins.quickreload.reloader
.getName Quick Reload - Stealing time back from Maven since 2013. Just press up arrow!
.getPluginInformation.getDescription
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName Atlassian
.getPluginInformation.getVenorUrl http://www.atlassian.com
.getPluginInformation.getVersion 3.0.0
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
httpservice-bridge Property Value
.getKey com.atlassian.labs.httpservice.bridge-0.6.2
.getName httpservice-bridge
.getPluginInformation.getDescription Base POM for Atlassian projects
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName Atlassian
.getPluginInformation.getVenorUrl null
.getPluginInformation.getVersion 0.6.2
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false
plugin-data-editor Property Value
.getKey com.atlassian.plugins.plugin-data-editor
.getName plugin-data-editor
.getPluginInformation.getDescription Plugin that provides an in-product editor utility for data stored with SAL’s PluginSettings or ActiveObjects.
.getPluginInformation.getParameters.# 0
.getPluginInformation.getVendorName Atlassian
.getPluginInformation.getVenorUrl http://www.atlassian.com/
.getPluginInformation.getVersion 1.2
.getPluginState “ENABLED”
.getPluginVersion 2
.isBundledPlugin false

These are in the API results but not in the UI:
httpservice-bridge
OSGi R4 Compendium Bundle

While a few are in UI but not API results:
Atlassian Troubleshooting and Support Tools
Atlassian Universal Plugin Manager
Jira Cloud Migration Assistant
SSO for Atlassian Data Center

Hi @KCWong,

If you’re using atlas-* tools you’re going to get a lot of ones included a normal site doesn’t have. Secondly, these ones

  • Atlassian Troubleshooting and Support Tools
  • Atlassian Universal Plugin Manager
  • Jira Cloud Migration Assistant
  • SSO for Atlassian Data Center

Come pre-installed, and so don’t appear in the list. If you upgrade them, they should appear. These are the ones that normally appear in a regular install (i.e. downloaded from Jira Server Download Archives | Atlassian)

So, it works as expected. If you want a customer experience, then set up Jira from a tarball and install the app manually.

James.

I’m more worried about the two additional items than the missing ones… OSGI and HTTP Bridge.

So I tried it on a standalone installation, and the UI gave me these:

While the API gave me 74 items. Some examples include:
Advanced Roadmaps Team Management
Advanced Roadmaps for Jira
Atlassian Chaperone
Atlassian Pocketknife API Commons Plugin
FishEye Plugin
Insight Plugin
JIRA Software Chinese (China) Language Pack

Hi @KCWong,

As I mentioned at the start, for JCMA/CCMA we also filter out a list of “pre-installed” apps, like the ones you’re finding to get to the list of real apps. You’re going to have to build that list yourself and remove them from the list you’re getting.

Then you’ll have the list of User Installed apps that you need.

Regards,
James.