Hi Experts.
I am creating issues through scheduler using com.atlassian.scheduler.SchedulerService. My scheduler is working fine but while creating issue i am getting exception which is in imgae.
My Code implementation:
import com.atlassian.scheduler.JobRunner;
import com.atlassian.scheduler.JobRunnerRequest;
import com.atlassian.scheduler.JobRunnerResponse;
import com.atlassian.scheduler.SchedulerService;
public class MyScheduler implements JobRunner {
@Override
public JobRunnerResponse runJob(JobRunnerRequest request) {
// Sync Employee and create issue
return JobRunnerResponse.success();
}
public void registerJob(long sysFreq, String sysMetrics) {
scheduler.unregisterJobRunner(JOB_RUNNER_KEY);
logger.info("Scheduling Job. Job id: "+JOB_ID);
scheduler.registerJobRunner(JOB_RUNNER_KEY, this);
final JobConfig jobConfig =
JobConfig.forJobRunnerKey(JOB_RUNNER_KEY).withRunMode(RunMode.RUN_LOCALLY)
.withSchedule(Schedule.forInterval(scheduleTime, null));
scheduler.scheduleJob(JOB_ID, jobConfig);
}
}
Note: Above code is my implementation for scheduler but it is having permission issue while creating issues. Exception is “anonymous user do not have permission to create issue in this project” but i am registering schedule by administrative credential. So how to give administrative access to my scheduler. Kindly need help to solve this permission issue.