I want to run a script each time Jira starts. I can't seem to find a "Jira just started" event but it there another event that reliably runs on startup ?
The thing is, you can't really catch a "Jira just started" as an event - because plugins get initialized in the "I'm online" status - so a plugin never really knows when Jira has or hasn't started.
When Jira starts up it will start waking up the plugins, so once the plugin has loaded, technically it would be "on startup", however, you could also just re-enable the plugin, or update it, and the same thing happens.
What you're after is more appropriate on OS level, but since you haven't said why you're interested in it, we don't know.
Maybe you might be able to figure out a workaround like getting the process uptime from OS and then evaluating in code whether it means a startup or not, or maybe there is some sort of an "uptime tracker" in Jira, maybe you could talk to the underlying OS and ask it stuff, or you could pass a jvm arg with startup timestamp each time you start/restart the process, so you could read it from the code and have a timestamp to work with to evaluate it, but all in all, not an event as far as I'm aware, at best - hacky workarounds.
I guess I could have a job that runs often and read uptime. Maybe it could set a "lastRuntAt" property to ensure it runs just once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Daniel Garcia ,
for my knowledge listener is at issue level so you can intercept event per issue basis and not for jira instance.
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, Jira throws events about virtually everything left and right. Issue events are just one small section of it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.