Optional dependency on ServiceDesk API

I’m working on a plugin that mostly only uses Jira Core, but sometimes should do a small extra thing for the Service Desk. Is it possible to build it so that the same Marketplace app, from the same Jar, would work on Jira without SD and provide some extra features when running with SD?

Obviously I can’t just inject SD services into my components, because such classes would not even load.

Is this even possible? How to achieve it?

When you create an app listing on Marketplace, you have an option of marking the app as compatible with JSD.

Thanks. I’m aware of this, but it’s not the question I’m asking.

My question is related to plugin development. Is it possible to build it so that the same Marketplace app, from the same Jar, would work on Jira without SD and provide some extra features when running with SD, using SD services?

I’d assume that those additional JSD features will be triggered from JSD UI? If so then you can just rely on the fact that when you need a JSD service it will be available for you.

Another thing is when you want different behavior in Jira Core. Then one of the common approaches is to create a web resource condition and load specific resources for a particular case. In the condition you can use PluginManager to identify e.g. service-desk-api plugin which part of JSD app.

Hope this helps.

These are a bit old - but take a look at:

https://bitbucket.org/bwoskow/optional-service-sample-plugin

1 Like

Thanks guys. Daniel’s solution looks very promising, that’s probably what I’m looking for.