To plugin, or not to plugin

Hi, I am trying to re-create an Atlassian Connect add-on for JIRA Server but I am not sure where to start.

I have created an add-on for JIRA Cloud which takes care of synchronizing data between JIRA and another project management tool (Forecast.it).

It does this by subscribing to a list of Webhooks which I use to send the data to Forecast, and I then use the data from the add-on installation handshake to send JWT authenticated requests back to JIRA.

Now, as I said, I need to do the same for JIRA Server.

I have been looking at the Plugins 2 framework and I can’t figure out if it is possible to subscribe to webhooks via a P2 plugin the same way as you can with a Connect add-on.

Does it even make sense to create a plugin to mimic the functionality of my cloud add-on, or should I just create a polling service that uses the REST api to synchronize the two systems?

Dunno about automatic but server has a config under admin where you can setup a webhook. Just give it a url and the specify the events you care about and you’re all set.

When developing a Jira server add-on, you can use event listeners instead. Keep in mind that in most cases, customers would not expect an P2 add-on to “phone home”. So be sure to directly interface with the project management tool from the customer Jira instance or be very explicit that you are using your servers to proxy the data between the Jira instance and Forecast.it

If it’s a single webhook, you could just use JIRA’s Webhooks ui - see https://confluence.atlassian.com/adminjiraserver071/managing-webhooks-802592245.html

Otherwise you’ll do event listeners as @remie mentioned. Word of caution: You’ll need to guard against timeouts (in some cases you’ll run on the request thread) as well as firewall oddities (some companies don’t allow outbound connections).

Thank you guys for your suggestions.
I have taken a look at event listeners, and it doesn’t look like there are any for sprints so I don’t think I can use those.

I don’t want the users to have to setup the webhooks themselves, but I saw that I can register webhooks with the REST api, so I think that might be my best bet.

Is there any place I can see the differences between server and cloud webhooks? I am guessing the webhooks may look different depending on the version of JIRA server?