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

This widget could not be displayed.
Mizan Community Champion Jan 15, 2014

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

This widget could not be displayed.

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?


This widget could not be displayed.
Mizan Community Champion Jan 15, 2014

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

This widget could not be displayed.

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.

This widget could not be displayed.

@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
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

122 views 1 3
Join discussion

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