I am new to the jira server plugin development. I am trying to create scheduler in the jira server. There is a problems I see here:
The atlas-run command builds and run the plugin successfully, but it doesn’t trigger the scheduler, and doesn’t print the line from the afterPropertiesSet() and runJob() method to the console
Please find the code at the following location for your review:
I need to learn from your experience, how to resolve this error. If this cannot be resolved, please point me to any working example for the jira server scheduler working for the latest version of the jira server.
Hello PrafullKulshrestha,
i understand that you’re new to Jira server plugin development and facing issues with the scheduler not triggering. Let’s go through some steps to troubleshoot and resolve this issue:
- Check Plugin Configuration: Ensure that your plugin is correctly configured in the
atlassian-plugin.xml
file. Make sure the job-config
module is enabled. Here’s an example configuration:
<job-config name="YourJobConfig" key="yourJobConfig">
<job key="yourJobRunner" perClusterJob="true"/>
<schedule cron-expression="0 0 0 * * ?" jitterSecs="10"/>
<managed editable="true" keepingHistory="true" canRunAdhoc="true" canDisable="true"/>
</job-config>
- Verify Job Runner: Ensure that your job runner class is correctly implemented and annotated. Here’s an example:
@Component
public class YourJobRunner implements JobRunner {
@Override
public JobRunnerResponse runJob(JobRunnerRequest request) {
System.out.println("Running the job");
return JobRunnerResponse.success("Job completed successfully");
}
}
- Enable Debugging: Enable additional logging to get more insights into what might be going wrong. You can set the logging level to
DEBUG
for the scheduler and job runner components:
<logger name="com.atlassian.scheduler" level="DEBUG"/>
<logger name="com.your-company.jira" level="DEBUG"/>
- Check Permissions: Ensure that your user account has the necessary permissions to run the scheduler and execute the job.
- Test with Atlas-Run: When using
atlas-run
, make sure you’re running the correct profile that includes the scheduler and job runner configurations.
Maybe it helps
Best regards
Daniel