Is there a way to force a plugin to execute last?


For one of our customers, we would like to know if there is a parameter or a tag to impose our custom developped plugin to be the last one to be executed in Jira.

Let me explain: we developped a plugin to create a link between Jira and a third party application. This application collects the worklogs and deal with the work time of each employee. On Jira side, we installed Tempo Timesheets so we cans precisely manage worklogs with more options than what Jira offers out of the box. Quite the standard process.

Problem is our custom plugin relies on Tempo’s execution : it gathers informations from the Tempo worklogs, then send these to the remote application. Here’s the catch: since we do not have any control on the order of execution of the installed plugins, sometimes our plugin executes before Tempo does, raising errors in the worklog process.

It would be great if we could set a priority parameter, to make sure our plugin would always be executed after Tempo (being the last executed one would be perfect). Does such parameter exists? If so, could you please tell me where and how to set it right?

Kind regards

Hi Alexis,
if I understand it correctly, you need to execute your custom plugin code after Tempo Plugin is initialized. I can see two options here:

  1. Use Spring Scanner and autowire any bean/service of your choice from Tempo plugin you need to use for work with the worklogs. It ensures that your service waits until Tempo pluing is initialized and continues with own initialization after that.
  2. You can listen on PluginEnabledEvent. However, the PluginEnabledEvent is not received just for your own plugin, but for all plugins that are enabled at some point after you registered the listener. You would have to use event.getPlugin().getKey() and compare that to Tempo plugin’s key to find it and then execute your code.

I hope that helps,


Thanks for the advise. My issue is not to wait for Tempo initialization, though : it is to make sure my custom plugin executes after Tempo does its job.

For example, let’s say one user logs some worktime on an issue. I need this worklogging process to be fully completed before my plugin starts its own process. 90% of the time, it is the case, but since we have no way to make sure my plugin will be the last one to work in the system, sometimes it runs its process before Tempo finished working, getting null worklog thus raising errors. I tried to include thread sleep in my code, but that does not help a lot.

I’m not even sure it is purely related to Tempo: I listen to events (WorklogCreatedEvent, WorklogUpdatedEvent, WorklogDeletedEvent), but it seems these events are not always fired when the process they advertise is fully completed (which does not make any sense in my opinion).

Is my case clearer?

Kind regards