How does Atlassian Scheduler work?


for my jira plugin, I need a cron scheduler that can execute a task on a fixed rate. There are various tutorials. The problem is, that everything I found in the internet has deprecated methods and classes such as PluginJob. It says to use Atlassian Scheduler instead. But how to use it? i have no clue, at all and the documentation is not enough for me to understand it. I’d like to have an example…

Here’s minimal example of Atlassian Scheduler usage.
Although in case you have only one job and no more are expected, it may make sense to combine PluginStateListener and UpdateSomethingScheduler in one class, because in my example UpdateSomethingScheduler extends PluginStateListener.

1 Like

Wow, thank you so so much! I’m going to try it now and will update you in a few days how it worked.What dependency did you use for the spring imports? And could you also share your Const class or how to retrieve the APP_KEY?


See Atlassian Spring Scanner

Const.APP_KEY is just a string. “groupId.artifactId” from pom.xml.

Thank you, I actually had that exact thing in my pom,xml, but java still seems to not recognize these imports. Is it because of the Atlassian version?

You mean compile time, or IDE highlighting? Anyways, you have to carefully follow the setup instructions for Atlassian Spring Scanner to make it work.

IDE highlighting. I can’t import them, although I followed the instructions in bitbucket… jira version is 9.4.0

If you’re using Intellij Idea, check your Maven settings in the IDE. They should point exactly to Maven provided by the Atlassian SDK.

I use eclipse. My problem is that in the application context I get this error: Description Resource Path Location Type cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'atlassian-scanner:scan-indexes'.

for the scan-idexes line and

Description Resource Path Location Type Error while downloading '' to xx : '[] with code: 404 Not Found'. plugin-context.xml

This is the file which I basically just copied from bitbucket

<beans xmlns=""