dotCMS / dotCMS/core

[TASK] Implement system jobs list and delete endpoints

Open
#35,207 1 comment 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #35831 by @hassandotcms — merged
Team : Modernization
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

Implement GET /v1/maintenance/_systemJobs and DELETE /v1/maintenance/_systemJobs/{group}/{name} in MaintenanceResource.java. The list endpoint returns all Quartz scheduler jobs with trigger details. The delete endpoint removes a specific job by group and name.

Acceptance Criteria

GET /v1/maintenance/_systemJobs

  • API caller must receive a list of all Quartz jobs across all job groups
  • Each job must include: name, className (simple name), group, durable, stateful, volatile
  • Each job must include: running (boolean from QuartzUtils.isJobRunning()), nextFireTime (epoch millis), nextFireTimeFormatted (human-readable string)
  • Each job must include misfireInstruction: "DO_NOTHING", "FIRE_ONCE_NOW", or "UNKNOWN" (for CronTrigger instances)
  • Jobs that fail to load (e.g., ClassNotFoundException after upgrade) must still appear in the list with an error field containing the exception message — these are the jobs users need to delete
  • Jobs with no trigger must be excluded from the list
  • Must require CMS Administrator role and Maintenance portlet access

DELETE /v1/maintenance/_systemJobs/{group}/{name}

  • API caller must be able to delete a Quartz job by its group and name
  • Endpoint must call QuartzUtils.removeJob(name, group)
  • API caller must receive confirmation with the deleted job's name and group
  • Must require CMS Administrator role and Maintenance portlet access
Priority

None

Additional Context
  • Job groups come from QuartzUtils.getScheduler().getJobGroupNames()
  • Job names per group from getScheduler().getJobNames(group)
  • Job details from getScheduler().getJobDetail(name, group) — may throw if job class no longer exists
  • Triggers from getScheduler().getTriggersOfJob(name, group) — first trigger is used for next fire time and misfire info
  • The JSP wraps each job in try/catch — jobs that throw exceptions get a delete button. The REST endpoint must replicate this by returning errored jobs with an error field
  • Struts legacy: ViewCMSMaintenanceAction._deleteScheduler() lines 282–289
  • JSP legacy: system_jobs.jsp lines 39–108

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in MaintenanceResource.java, then compare the legacy behavior in ViewCMSMaintenanceAction._deleteScheduler() lines 282–289 and system_jobs.jsp lines 39–108. Trace the QuartzUtils scheduler, job, and trigger calls described in the issue. Done means both protected endpoints expose the required job fields, preserve unloadable jobs with errors, exclude jobs without triggers, and delete by group and name.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.