Scheduling via SAL does not give required output


I followed this ( tutorial and set up a scheduled task for my plug-in. Even though no error is identified in the logs, no output is printed either. I'm just printing a few lines to make sure the scheduling works fine.

Dependencies added to pom.xml


Modifications to atlassian-plugin.xml

<component-import key="pluginScheduler">
    <description>SAL Scheduler</description>

<component key="SchedulerComponent" class="" system="true" public="true">
     	<description>The plug-in component that schedules the  router Task.</description>
The Task class..
import java.util.Date;
import java.util.Map;
import org.apache.log4j.Logger;

import com.atlassian.sal.api.scheduling.PluginJob;

public class RouterTask implements PluginJob{

	 private final Logger log = Logger.getLogger(RouterTask.class);
	public void execute(Map<String, Object> jobDataMap) {
		RouterTaskImpl taskImpl = (RouterTaskImpl) jobDataMap.get(RouterTaskImpl.KEY);"Running Task");
		assert taskImpl != null;
			taskImpl.printValue();"Task Completed");
			taskImpl.setLastRun(new Date());
		}catch(Exception e ){
			log.error("Exception Occured");


Task Implementation class..

public class RouterTaskImpl implements RouterScheduler,LifecycleAware{
	static final String KEY = RouterTaskImpl.class.getName() + ":instance";
	private static final String JOB_NAME = RouterTaskImpl.class.getName() + ":job";

	private final PluginScheduler pluginScheduler;
	private long interval = 5000L;
	private Date lastrun = null;
	private final Logger log = Logger.getLogger(RouterTaskImpl.class);
	public RouterTaskImpl(PluginScheduler pluginScheduler) {
		this.pluginScheduler = pluginScheduler;

	public void onStart() {
	public void reschedule(long interval){
		this.interval = interval;
		Date start = setStartTime();
		pluginScheduler.scheduleJob(JOB_NAME, RouterTask.class, new HashMap<String,Object>(){{put(KEY,RouterTaskImpl.this);}}, start, interval);"job Scheduled");
	public void printValue(){"Task running at (Newly Installed ).. " + new Date().toString() + "\n");
		System.out.println("Task running at " + new Date().toString() + "\n");
	void setLastRun(Date date) {
       lastrun = date;

	public Date setStartTime(){
		Calendar cal = Calendar.getInstance();

		Date startDate = cal.getTime();
		return startDate;
Monitor Class
public interface TicketRouterScheduler {

	public void reschedule(long interval);

Nothing seems to be wrong, yet the plug-in does not print anything as expected, not does it display a scheduled task under system-> Scehduler details.Any pointers on what I'm doing wrong here would be much appreciated.


5 answers

try using log.error() instead of then check your logs OR check the logging level in JIRA logging refer<br< a="">>

Hi Mizan,

Thanks a lot for your response. I tried out your suggestion but nothing related to the plug-in gets printed.Although I uploaded the plug-in and it is displayed under installed plug-ins, the plug-in does not seem to be working or communicating with the JIRA scheduler. According to what I've done here shouldn't this task be displayed/scheduled under System->Scheduler Details? Is there something specifically wrong with what I'm doing?


Hi Prameesha ,

You are right , this should get displayed under Scheduler Details but since it does not I believe there is some error in the atlassian-plugin.xml , you can check if you are reffering to correct classes and interfaces and there is no typo error .

Your monitor class is TicketRouterScheduler but in the xml i see it as RouterScheduler

Hi Mizan,

It was a typo with the question, and was accurate in the code. The problem was with the atlassian-plugin.xml as you suggested but it was with the SAL version given in the file. Fixed the error and the task works fine.

Thanks a lot for your support and suggestions, it was really helpful.

@Prameesha Samarakoon

Can you please let me know the fix of this problem?

I am stuck in the same.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,878 views 19 22
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you