Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

atlassian scheduler api runs the job more than once in Jira data center

I used atlassian scheduler api to run some code inside a plugin at 00.00 A.M everyday in a data center version of Jira. Although I added RUN_ONCE_PER_CLUSTER run mode to the scheduler service, it runs in all nodes. Is there a way to fix this?

class ScheduledJobRunner implements JobRunner {
private final SchedulerService schedulerService;

private JobRunnerKey JOB_RUNNER_KEY = JobRunnerKey.of(ExecutiveSummaryChangeScannerTask.class.toString() + "ResourceUtilization");
private static final JobId JOB_ID = JobId.of("resourceUtilization" + System.currentTimeMillis());
private ExecutiveSummaryChangeScannerTask table1Task = ExecutiveSummaryChangeScannerTask.getInstance();
private UtilizationPerProjectChangeScannerTask table2Task = UtilizationPerProjectChangeScannerTask.getInstance();
private DomainUtilizationChangeScannerTask table3Task = DomainUtilizationChangeScannerTask.getInstance();
private UtilizationPerPortfolioChangeScannerTask table4Task = UtilizationPerPortfolioChangeScannerTask.getInstance();

private final Logger logger = Logger.getLogger(ChangeScannerImpl.class);

public ScheduledJobRunner(SchedulerService schedulerService) {
this.schedulerService = schedulerService;

public void registerJob() throws SchedulerServiceException {
// register the implementation to be called by the scheduler
schedulerService.registerJobRunner(JOB_RUNNER_KEY, this);

if (schedulerService.getJobDetails(JOB_ID) == null) {
// schedule the job for running once in the first day of each month if it is not already scheduled
schedulerService.scheduleJob(JOB_ID, JobConfig.forJobRunnerKey(JOB_RUNNER_KEY)
.withSchedule(Schedule.forCronExpression("0 0 0 * * ? *"))

public void unregisterJob() {
// plugin is being disabled - no longer should execute this job (but other nodes might)

public JobRunnerResponse runJob(JobRunnerRequest request) {
logger.error("Runjob is being executed.");
//DataHolder holder = DataHolder.getInstance();

logger.error("Resource utilization data structures were prepared successfully");
logger.error("Runjob is being completed");
return JobRunnerResponse.success("Great success!");



0 answers

Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you