Writing scheduled tasks in JIRA

Have you ever thought of running scheduled tasks within JIRA? While services can run as scheduled tasks in JIRA 7, there might be scenarios where we want to do everything in code. We might want to remove the extra step of registering a service and the possibility of an admin deleting/editing/rescheduling the service.

Atlassian Scheduler API and the SchedulerService give us an easy way to write scheduled jobs in JIRA. In this recipe, we will write a simple scheduled task and see how to automatically register them.

Just like services, these scheduled tasks can also be part of a v2 plugin and can be uploaded using UPM.

How to do it...

Let us write a simple scheduled task that prints a line in the console. Perform the following ...

Get JIRA Development Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.